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.

class MyOnRemoteConfigsListener : public IRemoteConfigsListener
{
public:
MyOnRemoteConfigsListener() {}
void onRemoteConfigsUpdated();
};

void MyOnRemoteConfigsListener::onRemoteConfigsUpdated()
{
// add your code here
}

// in your function
auto myOnRemoteConfigsListener = std::make_shared<MyOnRemoteConfigsListener>();
gameanalytics::GameAnalytics::addRemoteConfigsListener(myOnRemoteConfigsListener);

To manually check if Remote Configs are ready (if they have been populated with values from the server) you can use the following method:

if(gameanalytics::GameAnalytics::isRemoteConfigsReady())
{
// the remote configs is ready, add your code here
}

After the remote configs have been populated you can retrieve their values by using the following function:

// Without custom default value (using normal default value)
std::string value = gameanalytics::GameAnalytics::getRemoteConfigsValueAsString("key");
// With custom default value
std::string valueWithCustomDefaultValue = gameanalytics::GameAnalytics::getRemoteConfigsValueAsString("key", "myDefaultValue");
caution

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

tip

For more information on Remote Configs go here.

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
auto abTestingId = gameanalytics::GameAnalytics.getABTestingId();

// A/B testing variant id
auto abTestingVariantId = gameanalytics::GameAnalytics.getABTestingVariantId();
info

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

tip

For more information on A/B Testing go here.