Configuration
GameAnalytics provides multiple features and options that need to be configured before initialzing the SDK.
If you are using the IAnalyticsProvider implementation, due to limitations of the interface, configuration will have to be setup inside Project Settings -> Plugins -> GameAnalytics
Set the Build Version
The build is used to specify the current version of your game. Specify it using a string. Recommended using a 3 digit version like [major].[minor].[patch]
The build version should be used for changing production builds of the game. We recommend creating a separate game when implementing or testing the SDK.
- C++
- IAnalyticsProvider
- Blueprint
GameAnalytics->ConfigureBuild(TEXT("1.0.0"));
If you are using the IAnalyticsProvider interface you will have to input the build version inside Project Settings -> Plugins -> GameAnalytics -> Build Version

Automatically send the build number
This feature is only available for Android and iOS builds!
Instead of manually setting the build version, you can enable the Send Version as Build Number option, the app version will automatically be detected and used for the build field.
- C++
- IAnalyticsProvider
- Blueprint
GameAnalytics->ConfigureAutoDetectAppVersion(true);
If you are using the IAnalyticsProvider interface you will have to input the build version inside Project Settings -> Plugins -> GameAnalytics

User ID
In order to identify users and keep track of events, GameAnalytics will issue an unique user id.
By default the GameAnalytics SDK will generate a default user for each user and requires no configuration (it will be assigned when the SDK is initialized for the first time and will persist across sessions).
The default user id depends on the platform:
| Platform | Default User Id |
|---|---|
| Android | Random Id |
| iOS | IDFV |
| Desktop (Windows, Linux, MacOS) | Random Id |
| WebGL | Random Id |
Set a Custom User ID
While the default user id will suffice for most use cases, you can also set a custom user id using the following function:
- C++
- IAnalyticsProvider
- Blueprint
GameAnalytics->ConfigureUserId("myCustomUserId");
AnalyticsProvider->SetUserID("myCustomUserId");

The user id must be configured before initializing the SDK and cannot be changed afterwards.
Set an optional External User ID
Besides the user id, GameAnalytics also supports an optional identifier called external user id which will be attached as to every event alongside the regular user id.
The external user id (unlike the normal user id) is not used internally by the GameAnalytics SDK, thus will not influence any metrics and can be changed anytime.
Read more about the external user id here
You can set the external user id by calling the following function:
- C++
- IAnalyticsProvider
- Blueprint
GameAnalytics->ConfigureExternalUserId("myCustomUserId");
The External User Id feature is not available inside the IAnalyticsProvider interface.

Configure Privacy
Disable Advertising ID Tracking
If the app has the required permissions, GameAnalytics will track the advertising IDs on certain platforms such as Android and iOS.
If you wish to disable tracking, for privacy reasons, you can call the following function:
EnableAdvertisingId
- C++
- IAnalyticsProvider
- Blueprint
GameAnalytics->EnableAdvertisingId(false);
This method is not available inside the IAnalyticsProvider interface.

This function will also force the default generated user id to be fully random on all platforms
Control Event Submission
You can manually turn off/on event submission for GA events. This is useful if you need, for GDPR purposes, to disable event submission.
- C++
- IAnalyticsProvider
- Blueprint
GameAnalytics->SetEnabledEventSubmission(false);
This method is not available inside the IAnalyticsProvider interface.

By default event submission is of course enabled. You will still receive configs if you have set any for your game even after disabling event submission.
Resources
When submitting resource events you will be required to specify a resource currency and resource item type. It is needed to specify a whitelist for each of these.
Currencies
If you want to track resource events you will first have to register currencies used inside your game before initializing the SDK. You cannot submit a resource event using other values than specified here in the settings.
- C++
- IAnalyticsProvider
- Blueprint
GameAnalytics->ConfigureAvailableResourceCurrencies({TEXT("copper"), TEXT("silver"), TEXT("gold")});
If you are using the IAnalyticsProvider interface you will have to input the available resource types inside Project Settings -> Plugins -> GameAnalytics

The following limitations apply:
- You can have a maximum of 20 resource types
- Each resource currency string can only contain letters (e.g:
[A-Za-z]).
Item Types
Additionally resource events will require an item type.
You can only submit resource events using item types that have been registered in the configuration.
Any item type not included in this list will be rejected by the SDK.
- C++
- IAnalyticsProvider
- Blueprint
GameAnalytics->ConfigureAvailableResourceItemTypes({TEXT("weapon"), TEXT("armor"), TEXT("amulet")});
If you are using the IAnalyticsProvider interface you will have to input the available resource types inside Project Settings -> Plugins -> GameAnalytics

The following limitations apply:
- You can have a maximum of 20 resource items
- Each resource currency string must only contain only alphanumeric characters
Set Custom Dimensions
Read more about custom dimensions here
GameAnalytics allows you to create up to 3 custom dimensions for your events.
Any value which is not defined will be ignored!
In code you can call the following functions to set the available custom dimensions:
- C++
- IAnalyticsProvider
- Blueprint
GameAnalytics->ConfigureAvailableCustomDimensions01({TEXT("human"), TEXT("orc"), TEXT("elf")});
GameAnalytics->ConfigureAvailableCustomDimensions02({TEXT("paladin"), TEXT("fighter"), TEXT("mage")});
GameAnalytics->ConfigureAvailableCustomDimensions03({TEXT("tank"), TEXT("dps"), TEXT("healer")});
If you are using the IAnalyticsProvider interface you will have to input the available resource types inside Project Settings -> Plugins -> GameAnalytics

After creating a whitelist of available custom dimensions, you can set up one of the allowed values for the current user.
- C++
- IAnalyticsProvider
- Blueprint
GameAnalytics->SetCustomDimension01(TEXT("human"));
GameAnalytics->SetCustomDimension02(TEXT("paladin"));
GameAnalytics->SetCustomDimension03(TEXT("tank"));
If you are using the IAnalyticsProvider interface you will have to input the available resource types inside Project Settings -> Plugins -> GameAnalytics

| Field | Type | Required | Description |
|---|---|---|---|
| customDimension | string | yes | One of the available dimension values set previously. Will persist cross session. Set to null to remove again. |
Manual Session Handling
The default session handling should suffice in most cases and it is recommended. However it is also possible to handle the session manually if necessary.
Do not use manual session handling unless it is absolutely necessary.
If sessions are not handled accurately this will result in inaccurate and skewed metrics being reported!
If enabled manual session handling will be enabled automatically just before initialization. To manual enable or disable session handling:
- C++
- IAnalyticsProvider
- Blueprint
GameAnalytics->SetEnabledManualSessionHandling(true);
If you are using the IAnalyticsProvider interface you will have to enable manual session handling inside Project Settings -> Plugins -> GameAnalytics

When you are using manual session handling you are responsible to accurately start and end sessions, failing to do so will result in inaccurate and skewed metrics being reported.
To start a session you will need to call the next function before being able to track events:
- C++
- IAnalyticsProvider
- Blueprint
GameAnalytics->StartSession();
//... play session
GameAnalytics->EndSession();
AnalyticsProvider->StartSession({});
// ... play session
AnalyticsProvider->EndSession();

Error Submission
You can enable error submissions to catch error and exception messages within Unreal when the game is running and submit them to GameAnalytics. This is useful for discovering unforeseen issues after the game has been launched. It will submit an error event using the type error, warning or critical.
After a game has been launched it will only send a maximum of 10 error events automatically. Some games can generate a lot of exceptions and this cap will prevent degraded performance and unintended bandwidth usage.
Native Error Reporting
If enabled the SDK will automatically send error event for native unhandled exceptions. In most cases the SDK can send the error event straight away when the app/game crashes but else the error event should be sent in next session.
- C++
- IAnalyticsProvider
- Blueprint
GameAnalytics->SetEnabledErrorReporting(true);
If you are using the IAnalyticsProvider interface you will have to configure Project Settings -> Plugins -> GameAnalytics
