$analytics.joinExperiment
This method makes the user join an experiment as part of A/B testing.
Syntax
The method accepts a string with the name of the necessary experiment.
- ECMAScript 5
- ECMAScript 6
$analytics.joinExperiment("Alternative greeting");
In the ECMAScript 6 runtime, the method is asynchronous:
await $analytics.joinExperiment("Alternative greeting");
The method randomly selects one of the experiment branches and returns its letter (from A
to E
).
caution
If the method is called repeatedly during one session, it returns the string value of
alreadyJoined
.