Skip to main content
Version: 1.6.0

A/B Testing

The A/B Testing module allows you to manage feature flags and experiment values remotely.

Configuration is done via the Settings Inspector in Unity.

Configuration is applied automatically at build time for each platform.

Platform markersโ€‹

The following markers are used to indicate platform availability of parameters and features:

  • (no marker) โ€” Shared parameter or feature
  • ๐Ÿ โ€” iOS-specific parameter or feature
  • ๐Ÿค– โ€” Android-specific parameter or feature
  • โš ๏ธ โ€” Not implemented in the Unity plugin yet

Ask your release manager for the required parameters before configuring the SDK.

Configureโ€‹

Configuration is done via the Settings Inspector.

Settings Inspectorโ€‹

FieldDescription
A/B Testing EnabledEnables/disables A/B testing functionality
A/B Default ValuesJSON string containing default A/B parameter values
Firebase A/B Enabled ๐Ÿค–Enables Firebase Remote Configโ€“based A/B testing
Firebase Fetch Interval ๐Ÿค–Minimum interval (in seconds) between Firebase config fetches

A/B Default Values are used when remote values are unavailable or before the first fetch.


Usageโ€‹

A/B Testing values are loaded automatically during SDK initialization.

You can request values at any time after initialization.


Get String Valueโ€‹

string value = P101XP.GetInstance().GetABTestingValue("test_key", "default_value");

Get Boolean Valueโ€‹

bool enabled = P101XP.GetInstance().GetABTestingBool("feature_enabled", false);

Get Integer Valueโ€‹

int count = P101XP.GetInstance().GetABTestingInt("max_lives", 3);

Get Float / Double Valueโ€‹

float multiplier = P101XP.GetInstance().GetABTestingFloat("reward_multiplier", 1.0f);

Refresh A/B Values ๐Ÿค–โ€‹

On Android, values can be fetched from Firebase Remote Config manually if needed:

P101XP.GetInstance().FetchABTestingValues();

Values are cached according to Firebase Fetch Interval ๐Ÿค–.


Automatic Behaviorโ€‹

  • A/B values are cached locally

  • Default values are returned if:

    • Remote config is unavailable
    • Fetch has not completed yet
    • A/B testing is disabled
  • Values may differ per user depending on experiment assignment


Naming Rulesโ€‹

  • Keys are case-sensitive
  • Use snake_case for keys
  • Keys must be agreed upon with backend / analytics teams

Exampleโ€‹

if (P101XP.GetInstance().GetABTestingBool("new_shop_ui", false))
{
ShowNewShop();
}
else
{
ShowOldShop();
}

Notesโ€‹

  • A/B Testing works independently from Analytics but integrates automatically when enabled
  • Changing default values requires rebuilding the application
  • Remote changes do not require app updates

Troubleshootingโ€‹

If A/B values are not updating:

  • Verify A/B Testing Enabled is ON
  • On Android: verify Firebase A/B Enabled ๐Ÿค–
  • Check Firebase Fetch Interval ๐Ÿค–
  • Confirm keys exist in the remote configuration
  • Ensure default values are valid JSON