Tracking API
Last updated
Was this helpful?
Last updated
Was this helpful?
Beware of the you choose, so that it is adapted to the context running API calls.
You can import using our dedicated API endpoint.
POST
https://api.mediarithmics.com/v1/datamarts/:datamartId/user_activities
The body of the request must be a User Activity object.
datamartId
integer
The ID of the datamart in which the user activity should be imported
Content-Type
string
application/json
body
object
The user activity object to import
Identification of the user or of the device is achieved through the $user_identifiers
property. We encourage you to use as many identifiers as available in your environment at the time of the capture.
A user profile can be created / updated by registering a user activity containing a $set_user_profile_properties
event. In that case you would need to use $user_account_id
and $compartment_id
inside $properties
to identify the user profile to update:
A user profile can be created / updated by registering a user activity containing a $set_user_choice
event.
This method is used when you want to achieve real-time tracking but can't use the mediarithmics JavaScript Tag. In mobile applications for example.
The attribute :userPointSelector
is used to select the user point on which apply the query. You can provide the following values :
An other way to create / update a user profile is to use the user_profiles API endpoint . Prefer this method if you are able to integrate various API endpoints and if you don't need to track the user profile update as an event for further retrieval.
PUT
https://api.mediarithmics.com/v1/datamarts/:datamartId/user_points/:userPointSelector/user_profiles/compartment_id=:compartmentId/user_account_id=:userAccount
The body of the request must be a User Profile object.
userAccount
string
The user_account_id linked to the user_profile that should be imported
compartmentId
integer
The ID of the compartment in which the user profile should be imported
datamartId
integer
The ID of the datamart in which the user profile should be imported
userSelector
string
The identifier of the user for whom the user profile should be imported. see the options of the user selector.
force_replace
boolean (optionnal)
If true, then the User Profile will be completely replaced by the object passed in the user_profile field.
If false, the object passed in the user_profile
field will be merged with the existing User Profile of the User Point.
merge_objects
boolean (optionnal)
Only considered if force_replace
is false.
Manage the comportement between two objects with a same property.
If false (default value), the new object overrides the existing one.
Content-Type
string
application/json
body
object
The user profile object to import
Beware of :
<COMPARTMENT_ID>
& <USER_ACCOUNT_ID>
which are used to select the user point
:compartmentId
& :userAccountId
which are used to select the profile to update
An other way to create / update a user choice is to use the user_choices API endpoint . Prefer this method if you are able to integrate various API endpoints.
PUT
https://api.mediarithmics.com/v1/datamarts/:datamartId/user_points/:userSelector/user_choices/processing_id=:processingId
datamartId
integer
The datamart ID
userSelector
integer
An identifier to the user point for which the user choice should be added.Could be :
processingId
integer
The ID of the associated processing
Body
object
The payload
GET
https://api.mediarithmics.com/v1/datamarts/:datamartId/user_points/:userSelector/user_choices/processing_id=:processingId
datamartId
integer
The datamart ID
userSelector
integer
An identifier to the user point for which the user choice should be added.Could be :
processingId
integer
Optional. The ID of the processing for which you want to list user choices.
Body
object
The payload
GET
https://api.mediarithmics.com/v1/datamarts/:datamartId/user_points/:userSelector/user_choices/processing_id=:processingId/change_log
datamartId
integer
The datamart ID
userSelector
integer
An identifier to the user point for which the user choice should be added.Could be :
processingId
integer
The ID of the processing for which you want to get user choices history.
Body
object
The payload
The body must be a valid object.
Please note that those events will go through the before being stored as a user choice. You must ensure no is removing them during that process.
If true the new object is merged in deep to the existing one (see ).
The body must be a valid object.