Skip to main content

A/B Experiments API

Integrating experiments through the SDK. Methods of operation.

List of Methods

Properties:

Checks:

Recommendations for Working with Experiments

  • Make changes to the game for side versions using the gp.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 (gp.experiments.has('EASY_LEVEL', 'easy')) {
difficulty = 'easy';
} else if (gp.experiments.has('EASY_LEVEL', 'extra_easy')) {
difficulty = 'extra_easy';
}

runLevel(difficulty);

Example using cohort value:

const difficulty = gp.experiments.map.EASY_LEVEL || 'normal';
runLevel(difficulty);

Properties

List of Experiments

FREE

You have access to the full list of experiments with their assigned cohorts upon launching the game and loading the player in key-value format.

gp.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 = gp.experiments.map.EASY_LEVEL || 'default';

Checks

Check Experiment Cohort

gp.experiments.has(tag, cohort) FREE

// By Tag
const hasEasyLevel = gp.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.

GamePush Community Telegram: @gs_community.

For your suggestions e-mail: [email protected]

We Wish you Success!