1. Funnel events

Add to cart event

The add to cart event (a2c:<page title>) must be sent when a user adds a product to the shopping cart. This event is required to compute cart abandonment metrics. If you do not send this event, the Sitecore Discover category and product analytics cannot report cart abandonment metrics.

The following table lists the attributes of the add to cart event:

NameTypeDescriptionValue
typeStringRequired.Type of the event.a2c
nameStringRequired.Name of the event, usually it is the name of the page where the event happened.home pdpcategory cartqview
value.productsArrayRequired.Array containing a single product object.n/a
value.products[].skuStringRequired.SKU of the product that the user added to the cart.n/a
value.products[].priceFloatRequired.Price of the product that is added to the cart.n/a
value.products[].quantityIntegerRequired.The number of units of products that a user added to the cart.n/a
value.products[].fitmentArrayRequired if site supports fitments.An array of fitment objects. Refer to products, fitments for more details.n/a
value.context.pageObjectRequired if site is set up with locale configuration.Add page-specific information (including locale information) under the page object.n/a
value.locale (deprecated)ObjectOptional.A locale object. This attribute is deprecated. We suggest you use the page object for locale data.n/a

Sample event specification

The following is an example of an add to cart event object. This example is in the new format, which means it contains a context object.

{
  "type": "a2c",
  "name": "home",
  "value": {
    "context": {
      "page": {
        "locale_country": "<country code, 2 letters, lowercase, e.g. fr>",
        "locale_language": "<language code, 2 letters, lowercase, e.g. en>",
        "locale_currency": "<currency code, 3 letters, lowercase, e.g. eur>"
      }
    },
    "products": [
      {
        "sku": "191258",
        "quantity": 1,
        "price": 11.99,
        "fitment": {
          "ids": [
            "3333"
          ]
        }
      }
    ]
  }
If you have suggestions for improving this article, let us know!