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.
The activity object contains essential data for event tracking, comprising five unique properties, as shown below:
Action
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:
If you would like to track additional actions, you can do so using custom actions.
Target
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.).
User
The user property is an object detailing the user characteristics you are tracking.
You can find more information on the user object in the Identities section.
Source ID
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.
Handling infinite scroll
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.
Pagination events are not tracked. If you would like to track pagination events, request a custom action.
Metadata
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.
Last updated