Skip to main content

Game Ops

Remote Configs

You can register a callback to be notified when the RemoteConfigs have been updated with values from the server using the function below:

class MyOnRemoteConfigsUpdateFunction : IRemoteConfigsListener
{
public void OnRemoteConfigsUpdated()
{
// add your code here
}
}

MyOnRemoteConfigsUpdateFunction myOnRemoteConfigsUpdateFunction = new MyOnRemoteConfigsUpdateFunction()
GameAnlytics.AddRemoteConfigsListener(myOnRemoteConfigsUpdateFunction);

To manual check if Remote Configs is ready (has been populated with values) you can call this:

if(GameAnalytics.IsRemoteConfigsReady())
{
// the command center is ready, add your code here
}

To get values out of a populated Remote Configs use the following methods:

// 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 Config it will return the default value either normal or custom default value.

A/B Testing

To get the value of A/B testing id or variant id use the following methods:

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

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

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

Custom Dimensions

GameAnalytics support the use of up to 3 custom dimensions.

  • Custom01
  • Custom02
  • Custom03

During the game it is possible to set the active value for each custom dimension dynamically. Once a dimension is set it will be persisted across sessions/game-start and automatically be added to all event categories. Remember you have to set the custom dimensions before initialzing the SDK (but after setting the available custom dimensions) to be able to add the dimensions to the first session start event.

Setting each custom dimension. To reset a set custom dimension simply just set it to empty string or null.

GameAnalytics.SetCustomDimension01("ninja");
GameAnalytics.SetCustomDimension02("dolphin");
GameAnalytics.SetCustomDimension03("horde");

GameAnalytics.SetCustomDimension03(""); // reset custom dimension 3

|Field|Type|Description|Example| |customDimension|string|One of the available dimension values set in the configuration phase. Will persist cross session. Set to empty string or null to reset.|ninja|

tip

Read more about custom dimensions here.

Custom Event Fields

During the game it is possible to set global custom event fields which you can change at any time. Custom event fields is basically a set of key-value pairs you can add to all your events.

caution

It is important to know that the custom event fields will not visible in the GameAnalytics tool as it is only accessible through raw export. There is a limit of using 50 custom event fields per event, keys can max consist of 64 characters and values (when strings) can max consist of 256 characters.

But remember custom event fields can only be used together with raw event export and which they will not visible in the tool. It is also possible to overwrite the global custom event fields by using the optional custom event fields parameter for when sending individual events, please refer to the events documentation page for usage.

Setting global custom event fields:

Dictionary<string, object> customFields = new Dictionary<string, object>();
customFields.Add("test", 666);
customFields.Add("test_2", "global_hello_world");
GameAnalytics.SetGlobalCustomEventFields(customFields);
FieldTypeDescriptionExample
customFieldsdictionaryA set of key-value pairs. Values can be strings or numbers{
"test": 666
"tests": "hello_world"
}
tip

For more information on custom event fields and raw data export go here.

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