The Activity Object

The Activity object must respect this formatting. The more information you send, the more analytics insights and merchandising possibilities it will enable.

An activity must at least contain the action and target properties. You should also include the user if you're not sending it through the SDK.

{
    "action": {{ACTION}}, // String : The user's action
    "target": { // target of your action
        /* example */
        "product": {{product_id}}
        /* OR */
        "facet": {{facet_id}}, /* the facet id and the value for that id as key */
        "{{facet_id}}": {{facet_value}}
        /* If the action is on a search result, then include the search term */
        "search-terms": {{search_term}}
    },
    /* If the action is on a search result, navigation result, item detail
    page or a recommendation, then send the source ID as String */
    "sourceId": {{source_id}},
    "metadata": {
        /* metadata is a object containing all additional
        contextual data on the performed action */
        "price": {{price}},
        "quantity": {{quantity}},
        "currency": {{currency}}, // ISO 4217 standard, example "EUR" 
        "locale": {{locale}} // locale, with language and country codes, example "en_GB"
         โ€ฆ
        /* any additional metadata properties */         
    },
    "segments": ["XXX", "YYY"] // the activity segments
    "user": USER_Object, // see the user identification section
    "timestamp": {{timestamp}} // ISO 8601 format, as String
}

Currency format details here: ISO_4217 Timestamp format details here: ISO_8601 (including MS at the end, ex: 2011-08-12T20:17:46.384Z).

For more information about the user object formatting, see below:

Last updated