Skip to main content

Game Ops

Remote Configs

GameAnalytics offers the option to setup remote configs in your dashboard that can be changed on the whim without needing to release a new version of the game. The remote configs are a custom set of key-pair values.

In Unity you can register for the following event in order to check when the Remote Configs have been updated.

private static void MyOnRemoteConfigsUpdateFunction()
{
// add your code here
}

GameAnlytics.OnRemoteConfigsUpdatedEvent += MyOnRemoteConfigsUpdateFunction;

You can as well manually check if the Remote Configs have been populated using GameAnalytics.IsRemoteConfigsReady():

if(GameAnalytics.IsRemoteConfigsReady())
{
// the remote configs is ready, add your code here
}
caution

Remember the remote configs can be populated with an empty dictionary if the device is offline and there are no cached remote configs from a previous session.


After you have checked if the configs have been populated you can use the following methods to retrive their values:

// Without custom default value (using normal default value)
string value = GameAnalytics.GetRemoteConfigsValueAsString("key");
// With custom default value
string valueWithCustomDefaultValue = GameAnalytics.GetRemoteConfigsValueAsString("key", "myDefaultValue");
info

If the specified key is not found in the Remote Configs it will return the default value either “normal” or “custom” default value.

A/B Testing

After configuring an A/B test in your GameAnalytics dashboard you can retrive the testing ids with the following methods:

// A/B testing id
string abTestingId = GameAnalytics.GetABTestingId();

// A/B testing variant id
string abTestingVariantId = GameAnalytics.GetABTestingVariantId();
info

Remember that the A/B testing ids are first available when the Remote Configs are ready.