Skip to main content
Version: 1.6.0

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​

FieldDescription
Analytics Project IdAnalytics 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)​

FieldDescription
User Tracking Description 🍏⚠️Text shown in the system IDFA/Tracking permission dialog

AppsFlyer​

FieldDescription
Appsflyer Track EnabledEnables/disables Appsflyer event tracking
Appsflyer Debug Log EnabledEnables/disables Appsflyer debug logs
Appsflyer Developer KeyAppsflyer developer key

Adjust​

FieldDescription
Enable AdjustEnables/disables Adjust
Adjust Track Enabled 🍏Enables/disables Adjust event tracking
Adjust App TokenAdjust application token
Adjust Event MapJSON 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​

FieldDescription
Sentry DSNSentry 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;

Use the following event names for sending common game analytics events:

af_login​

Attributes:

  • player_id — character / in-game account ID
  • player_name — in-game name
  • server_id

Description: track user login events (login to the server).

af_level_achieved​

Attributes:

  • af_level — level gained by a character
  • player_id
  • player_name
  • server_id

Description: track level achieved.

af_tutorial_completion​

Attributes:

  • player_id
  • player_name
  • server_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_id and mobile_id as 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