Analytics Tracking
Consult with the Treasure team to develop a data dictionary / taxonomy prior to telemetry instrumentation
Our analytics tracking system allows you to track custom client-side events and properties to better understand your users’ behavior. Integration is simple and requires only a few lines of code.
Usage
To use analytics please let us know and in a private channel we’ll provide you
the {DATA_PLATFORM_URL}
and the X-API-Key
header value to use.
Initialize an instance of the AnalyticsManager class
Use your {X-API-Key}
and {DATA_PLATFORM_URL}
along with an identifier for your app, the version of your app and the environment (dev/prod).
A cartridge_tag
is assigned to your game by Treasure.
Track a custom event
Track a custom event with the trackCustomEvent
method.
The method accepts a TrackableEvent
object with the following properties:
- A player ID: You must include one of or both
smart_account
anduser_id
. Thesmart_account
is the Ethereum wallet address for the player. Theuser_id
is some unique identifier for the player that you choose, such as an email address or a player ID. name
: The name of the event, which you define.properties
: An object containing the event properties. Property values can be strings, numbers, booleans, null, or arrays and objects of these types.
snake_case
for event and parameter names