A/B Experiments API
Integrating experiments through the SDK. Methods of operation.
List of Methods
Properties:
ss.experiments.map
- list of experiments. FREE
Checks:
ss.experiments.has()
- check which cohort the player is currently in for an experiment. FREE
Recommendations for Working with Experiments
- Make changes to the game for side versions using the
ss.experiments.has()
check. - Always have a default version (A) to roll back to if needed.
- In the default version (A), don't rely on the check, consider it the main version. Use overrides for other versions below or leave the A version as else.
- Calibrate the version through an A/A test. Create an experiment and assign percentages to cohorts, but don't make any changes to the game. Make sure the metrics between these two versions are the same, then you can run the test. If there is a significant difference in metrics between the versions, reassign players to cohorts by clicking the "Reshuffle" button.
Example using check:
let difficulty = 'normal';
if (ss.experiments.has('EASY_LEVEL', 'easy')) {
difficulty = 'easy';
} else if (ss.experiments.has('EASY_LEVEL', 'extra_easy')) {
difficulty = 'extra_easy';
}
runLevel(difficulty);
Example using cohort value:
const difficulty = ss.experiments.map.EASY_LEVEL || 'normal';
runLevel(difficulty);
Properties
List of Experiments
FREEYou have access to the full list of experiments with their assigned cohorts upon launching the game and loading the player in key-value format.
- JavaScript
- Unity
ss.experiments.map;
SS_Experiments.Map();
Example structure:
{
EASY_LEVEL: 'easy',
OFFER_ON_START: 'sale_50',
NO_RESTART: 'no_button_after_2nd_death',
EXTRA_REWARD: ''
}
Example usage:
const difficult = ss.experiments.map.EASY_LEVEL || 'default';
Checks
Check Experiment Cohort
ss.experiments.has(tag, cohort)
FREE
- JavaScript
- Unity
// By Tag
const hasEasyLevel = ss.experiments.has('EASY_LEVEL', 'easy');
// Check
if (hasEasyLevel) {
// Cohort easy is active in the EASY_LEVEL experiment
}
// By Tag
bool hasEasyLevel = SS_Experiments.Has('EASY_LEVEL', 'easy');
// Check
if (hasEasyLevel) {
// Cohort easy is active in the EASY_LEVEL experiment
}
Stay in Touch
Other documents of this chapter available Here. To get started, welcome to the Tutorials chapter.
SpellSync Community Telegram
: @spellsync.
For your suggestions e-mail
: [email protected]
We Wish you Success!