Analytics
For analytics, the 101XP SDK uses:
- 101XP Analytics (ClickHouse-based implementation)
- Appsflyer
- Adjust
- Sentry
- Firebase Analytics
Configuration is done via the Settings Inspector in Unity.
Configuration is applied automatically at build time for each platform.
Platform markers
The following markers are used to indicate platform availability of parameters and features:
- (no marker) — Shared parameter or feature
- 🍏 — iOS-specific parameter or feature
- 🤖 — Android-specific parameter or feature
- ⚠️ — Not implemented in the Unity plugin yet
Ask your release manager for the required parameters before configuring the SDK.
Configure
Configuration is done via the Settings Inspector.
101XP Analytics
| Field | Description |
|---|---|
| Analytics Project Id | Analytics Project Id for the production environment |
| Analytics Project Id (Dev) | Analytics Project Id for the sandbox/test environment (usually 10000) |
On Android, the test environment is detected by install referrer (for example, a referrer value like
test).
User Tracking (iOS)
| Field | Description |
|---|---|
| User Tracking Description 🍏⚠️ | Text shown in the system IDFA/Tracking permission dialog |
AppsFlyer
| Field | Description |
|---|---|
| Appsflyer Track Enabled | Enables/disables Appsflyer event tracking |
| Appsflyer Debug Log Enabled | Enables/disables Appsflyer debug logs |
| Appsflyer Developer Key | Appsflyer developer key |
Adjust
| Field | Description |
|---|---|
| Enable Adjust | Enables/disables Adjust |
| Adjust Track Enabled 🍏 | Enables/disables Adjust event tracking |
| Adjust App Token | Adjust application token |
| Adjust Event Map | JSON map of SDK event names to Adjust event tokens |
| Adjust Sandbox 🤖 | Switch between sandbox and production mode |
| Adjust Log Level 🤖 | Adjust log verbosity (`VERBOSE |
Sentry
| Field | Description |
|---|---|
| Sentry DSN | Sentry DSN (provided by your release manager) |
| Sentry Environment 🤖 | Optional environment name used to split events inside one Sentry project |
| Sentry Debug Mode 🍏 | Enables debug mode (used by the SDK when set to true) |
Usage
Track Analytics Event
Send an analytics event with optional parameters:
// Event without parameters
P101XP.GetInstance().SendAnalyticsEvent("test", null);
// Event with parameters
var values = new Dictionary<string, object>
{
{ "test", "value" },
{ "score", 123 }
};
P101XP.GetInstance().SendAnalyticsEvent("test", values);
Conversion Data (Adjust)
To receive Adjust conversion data, subscribe to the conversion data callback/event:
private void OnGetAnalyticsConversionData(Dictionary<string, object> conversionData)
{
}
P101XP.GetInstance().AnalyticsConversionDataEvent += OnGetAnalyticsConversionData;
Recommended Event Names
Use the following event names for sending common game analytics events:
af_login
Attributes:
player_id— character / in-game account IDplayer_name— in-game nameserver_id
Description: track user login events (login to the server).
af_level_achieved
Attributes:
af_level— level gained by a characterplayer_idplayer_nameserver_id
Description: track level achieved.
af_tutorial_completion
Attributes:
player_idplayer_nameserver_id
Description: track tutorial completion.
Example
var values = new Dictionary<string, object>
{
{ "player_id", yourPlayerId },
{ "player_name", yourPlayerName },
{ "server_id", yourServerId }
};
P101XP.GetInstance().AnalyticsTrack("af_login", values);
Do not use
user_idandmobile_idas attributes — they are reserved by the 101XP Mobile SDK.
Sentry
Configure
Sentry is enabled by providing Sentry DSN in the Settings Inspector.
Usage
Send a Sentry event:
P101XP.GetInstance().TrackSentryEvent("event_name", new Dictionary<string, object>
{
{ "test", 0 }
});
Send a Sentry event without parameters:
P101XP.GetInstance().TrackSentryEvent("event_name", null);
Send an exception:
try
{
throw new Exception("Exception message");
}
catch (Exception ex)
{
P101XP.GetInstance().TrackSentryException(ex);
}
FAQ
Analytics requires that the user accepts the EULA. If your project does not show authorization/EULA UI, disable showing the license agreement and enable auto-accept in the Settings Inspector:
- EULA Show Enabled =
false - EULA Auto Accept =
true