Activity object
Understand the activity object structure for event tracking: action, target, user, source ID, and metadata. Includes built-in actions and metadata recommendations for XO and FHR.
Last updated
Understand the activity object structure for event tracking: action, target, user, source ID, and metadata. Includes built-in actions and metadata recommendations for XO and FHR.
Last updated
The activity object contains essential data for event tracking, comprising five unique properties, as shown below:
The action property is a string describing the action performed by the user (i.e. the event the user has triggered).
Our system supports five built-in actions:
e
The target property is an object detailing the target the action was performed on (i.e. the subject of the event).
Targets are action specific (e.g. product id, path to page etc.).
The user property is an object detailing the user characteristics you are tracking.
The source ID links an activity to a specific context or origin. When a user takes an action, the source ID helps trace it back to a particular touchpoint, such as a page, a search term, or a specific marketing campaign.
The source ID property is a string describing the ID that associates the FHR or XO response with the event.
For activities linked to a FHR or XO context the source ID must correspond to the response ID.
For example: If a user clicks on a product recommendation, the source ID might link that action to the specific recommendation engine or search query that suggested the product.
To ensure accurate reporting, use the FHR or XO response ID exclusively for actions related to the features provided by that specific response.
Avoid including a source ID that is unrelated to the action.
First response: The initial set of results corresponds to the first response. Activities performed on these products should use the source ID from this response.
Subsequent responses: When a user scrolls and additional content is loaded (e.g., a second page of results), the new products should reference the source ID from the corresponding response.
The metadata property is an object detailing additional data related to the action that you are tracking, for example:
Locale (language and region)
Device type (mobile, desktop)
Quantity
Price
When using XO, we recommend you include the metadata.context
field. This is a string field describing the context that the event took place in. Values for this field are user defined and can take any format (e.g. "sale", "french", "1").
When using FHR, we recommend you include the metadata.locale
field. This is a string field describing the locale that the event took place in. Values for this field must adhere to the following format: xx_YY (e.g. "en_GB", "en_US", "fr_FR").
Additional fields in the metadata
object are action specific and may be required.
You can find more information on the user object in the .
You can find various examples for the FHR response object . The response ID, that you should use as source ID for tracking, corresponds to the rid
in the FHR response object.
Pagination events are not tracked. If you would like to track pagination events, request a .