Mobile apps tracking
Last updated
Last updated
In order to track activities on your mobile app, you'll need to keep in mind the following :
All mobile user activities need to be sent to mediarithmics using the Tracking API
The Signature authentication should be used to authenticate any requests between your app and mediarithmics. Don't hesitate to contact your Account manager to have more information about this.
The activity and events in the payload need to comply with mobile app specificities described in the next section
The user agent identifier ($user_agent_id) needs to be particularly formatted using mobile application identifiers guidelines
The first option is to integrate a small piece of code (approx. 100 lines) into the mobile application to execute calls to the mediarithmics tracking API. Sample code for iOS and Android is available in the Authentication section (see illustration below).
The second option is to re-use an existing analytics tool. It is then possible to transfer events from the analytics solution's server to the mediarithmics API.
In the context of Mobile App Tracking, predefined event names are available out-of-the-box to simplify and automate event processing (full list of predefined event names):
app open event ($app_open
) corresponds to the opening of the app and app resume event (when the app becomes active again)
app install event ($app_install
)
app update event ($app_update
)
The install and update events are automatically calculated on server side and you don't have to send them :
The install event ($app_install
) is triggered the first time an app open event is received for a user, regardless if the user is new or existing.
The update event ($app_update
) is triggered when the SDK version, app version or OS version changes from one open to the next.
In the context of Mobile App Tracking, some fields of the User Activity objects have a limited set of possible values. Details below:
$type
String enum
The activity type should only be APP_VISIT
$session_status
String enum
The sessions status should be:
IN_SESSION
: This value should be used if you’re making one API call per tracked event (recommended way). The platform will automatically aggregate all the events of a session sent through many API calls when this value is used.
CLOSED_SESSION
: should be used only if you do a single API call per session at its end. In this case, you should provide ALL the events of the session in the $events
array in the call. Each API call with this value will generate a new User Activity in the Platform.
$user_agent_id
String (Optional)
The user agent identifier of the user device containing a unified representation of an advertising id.
Ex: mob:ios:raw:6d92078a-8246-4ba4-ae5b-76104861e7dc
for a raw IDFA on iOS platform.
$app_id
String
The mobile app id (previously created through Navigator / API)