Add to cart

Track add-to-cart actions to measure conversion rates. Send a new event for each distinct product added, including product, quantity, and variant details.

This section is relevant for both FHR and XO customers.

Add to cart actions are used to calculate add to cart (or add to basket) conversion rates. Although typically restricted to a PDP, this action may be performed in a range of contexts.

Whenever a user adds a product to a cart (or basket) you should send an add-to-cart event.

Properties

{
    "action":"add-to-cart",
    "target": {
        "product":"product-id"
    },
    "sourceId": "source-id",
    "metadata": {
        "quantity": 1,
        "variant": "variant-id"
    }
}
Property
Context
Description

action

All

Must be specified as "add-to-cart"

target.product

All

The ID of the product that was added to cart; must be identical to the product ID used in FHR/XO

metadata.quantity

All

The quantity of the product added to cart

sourceId

All

The ID that associates the FHR or XO response with the event; i.e. response ID

metadata.*

All

Additional information, such as context or locale

metadata.query

The add-to-cart event is triggered on search results

The search terms that generated the viewed search results

metadata.variant

All

The ID of the product variant that has been added to the cart; must be identical to the variant ID used in FHR/XO

Last updated