Analytics SDK behaviour

The Analytics SDK is designed to exist seamlessly behind your game logic, able to collect events and upload them efficiently without causing frame spikes or battery drain. It is also designed to be resilient to upload failure due to intermittent internet access.

It does this by recording events first into an in-memory buffer, and then uploading them in batches to the back-end. The flush period is 60 seconds and this is not configurable, but you can call AnalyticsService.Instance.Flush() to manually trigger an immediate upload if necessary.

There might be occasions where the SDK fails to send a batch of events, for example, when the Analytics service is down or the player is offline. Events are stored in memory until they're successfully uploaded or the app is shut down. If there's still no internet connection when the app is shut down, and file system access is available, up to 5MB of events are cached to disk so that they can be uploaded during the next session.

Events are always uploaded with the data they had when they were recorded, including common parameters like platform and session ID. For example, if an event was recorded in a previous session but only flushed days later, it'll keep its association with its original session.