Chuyển tới nội dung chính

Unity Analytics

Attribution (Adjust or AppsFlyer, one per game) is configured by the Alogame backend, with no local setup. Firebase Analytics uses the Firebase files from Installation. Lifecycle events and the native IAP revenue event (sdk_recharge) are tracked automatically; see Android Analytics for the full list and for what changes with AppsFlyer.

Log an event​

C#
await AlogameAnalytics.LogEvent("tutorial_complete");

await AlogameAnalytics.LogEvent("level_up", new Dictionary<string, object>
{
["level"] = 10,
["server"] = "S1",
});

Log a revenue event​

Events that carry money (Recharge from web_store / WebPay top-ups, first_recharge, or a custom revenue event) must use LogRevenue. An amount sent only as a plain parameter is not counted, and the dashboard shows 0.

C#
// LogRevenue(eventNameOrToken, revenue, currency, orderId, parameters)
await AlogameAnalytics.LogRevenue("Recharge", 99000, "VND", "order_12345");

Native in-app purchases need no call: the SDK sends sdk_recharge with the revenue set.

Enable / disable tracking​

For a consent screen:

C#
await AlogameAnalytics.SetTrackingEnabled(false);

iOS App Tracking Transparency​

The SDK requests ATT itself. The package writes NSUserTrackingUsageDescription into every iOS build; set your own wording on the AlogameSDKSettings asset.

AppsFlyer OneLink data reaches C# as AlogameAnalytics.DeepLinkResolved; see OneLink.