Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Configuration

Martin Treacy-Schwartz edited this page Aug 2, 2017 · 5 revisions

The configuration phase happens before initialization is called. The available configuration options are listed here.

  • build
  • custom userId
  • available (allowed) custom dimensions
  • available (allowed) resource currencies
  • available (allowed) resource item types

Build

Build is used to specify the current version of your game. Specify it using a string. Recommended to use a 3 digit version like [major].[minor].[patch]

 // Set build version
 gameanalytics::GameAnalytics::configureBuild("android 1.0.0");

Custom userId

The SDK will automatically generate a user id and this is perfectly fine for almost all cases.
Sometimes it is useful to supply this user_id manually - for example if you download raw data for processing and need to match your internal user id (could be a database index on your user table) to the data collected through GameAnalytics. Do not use a custom userId unless you have a specific need for using it.

 

Note that if you introduce this into a game that is already deployed (using the automatic id) it will start counting existing users as new users and your metrics will be affected. Use this from the start of the app lifetime when you need.

 gameanalytics::GameAnalytics::configureUserId("user1234567879");

Specifying allowed values

For certain types it is required to define a whitelist containing possible unique values during the configuration phase. When the SDK is being used (after initialization) only the specified values will be allowed. 20 values are allowed for each list.

 

ℹ️
Processing many unique dimension values can be taxing for our servers. A few games with a poor implementation can seriously increase our cost and affect stability. Games will be blocked if they submit too many unique dimension values. We have this configuration requirement to guide users into planning what dimension values can be used.

 

{
    std::vector<std::string> list;
    list.push_back("gems");
    list.push_back("gold");
    gameanalytics::GameAnalytics::configureAvailableResourceCurrencies(list);
}
{
    std::vector<std::string> list;
    list.push_back("boost");
    list.push_back("lives");
    gameanalytics::GameAnalytics::configureAvailableResourceItemTypes(list);
}
{
    std::vector<std::string> list;
    list.push_back("ninja");
    list.push_back("samurai");
    gameanalytics::GameAnalytics::configureAvailableCustomDimensions01(list);
}
{
    std::vector<std::string> list;
    list.push_back("whale");
    list.push_back("dolphin");
    gameanalytics::GameAnalytics::configureAvailableCustomDimensions02(list);
}
{
    std::vector<std::string> list;
    list.push_back("horde");
    list.push_back("alliance");
    gameanalytics::GameAnalytics::configureAvailableCustomDimensions03(list);
}

 

ℹ️
Each resource currency string should only contain [A-Za-z] characters.

 

NEXT  →

Clone this wiki locally