Send user events
To track how far a user is progressing through your app you can send a user event at specific points to the justtrack backend. Using this, you can determine whether there are any specific steps at which a lot of users drop out (e.g., at a specific level or before making some in-app purcharse). The following calls are all equal and publish a user event called event_name
to the backend:
You can however add additional information to an event to easier analyze it later using the justtrack dashboard. The EventDetails
class allows you to amend an event with a category, an element, and an action. On the dashboard you can then filter for all events with, e.g., a specific category, looking at multiple connected events at the same time. The CustomUserEvent
class allows you to amend your events with up to three custom dimensions as well as a value and a unit. The custom dimensions allow you to split events on the dashboard again by some criterium. For example, in a game a player might acquire an item. You could be interested in the rarity of each item acquired, e.g., to see how many users acquire a rare item on their first day (as the dashboard allows you to look at different cohorts of users):
If you need to track how much time a user needs for a level, you can attach a value and a unit to an event. In the following example, we measure the time it takes a user to complete the level and then attach it to the event before sending it to the backend:
The units supported by the justtrack SDK are Count, Seconds and Milliseconds. Alternatively, an event can carry a monetary value instead of a value with a unit:
Standard events
In the previous example we actually did a bad emulation of an event already defined by the justtrack SDK. The code should actually have looked like this:
The first two arguments in the constructor are called elementName
and elementId
. Standard events accept additional dimensions next to the three custom dimensions you can use on custom user events. For the ProgressionLevelFinishEvent
these are elementName
and elementId
, which you can (but don't have to) use to record about which level you are actually talking. Thus, a call could look like this (hardcoding the arguments for simplicity):
As you can see, we dropped the duration, so it seems like it is no longer available. This is not a limitation of the standard events (for example, the LoginProviderauthorizationFinishEvent
is a standard event which can provide a duration, too). Instead, the justtrack SDK is already measuring the duration for us and will provide it automatically.