Skip to main content

Auto-tracking

Last updated 08/27/2026

The TDAnalytics SDK supports auto-tracking of three events:

  • ta_app_install: Game install. This event is collected when the game is opened for the first time after installation
  • ta_app_start: This event is collected when the game enters the foreground
  • ta_app_end: This event is collected when the game moves to the background

Call enableAutoTrack to enable auto-tracking:

// Enable auto-tracking
TDAnalytics::enableAutoTrack();

Note: If you need a custom distinct ID, make sure you call the setDistinctId API to set the distinct ID before you enable auto-tracking.

Starting from v1.3.2, you can set custom properties for auto-tracked events. When a specified event is collected, the custom properties are merged into its event properties and reported.

// Enable auto-tracking and set custom properties
TDJSONObject autoProperties;
autoProperties.setString("auto_track_key", "auto_track_value");
TDAnalytics::enableAutoTrack(autoProperties);
Was this page helpful?