Cart Viewed

Description

This client-side event fires whenever a customer views their shopping cart.

Instrumentation

This event is implemented with our javascript analytics library. The tracking code is managed in the Shopify storefront theme.

Event Properties

Property

Type

Description

products

Array

Products displayed in the product list

products.$.product_id

String

Product ID displayed on the list

products.$.sku

String

Sku of the product being viewed

products.$.name

String

Name of the product being viewed

products.$.brand

String

Brand associated with the product

products.$.variant

String

Variant of the product (e.g. Black)

products.$.price

Number

Price ($) of the product being viewed

products.$.quantity

Number

Quantity of a product

products.$.position

Number

Position in the product list (ex. 3)

products.$.url

String

URL of the product page

products.$.image_url

String

Image url of the product

Example:

analytics.track('Cart Viewed', {
  products: [
    {
      product_id: '504l1f77bcf86cd799439022',
      sku: '95790-33',
      name: 'Monopoly: 3rd Edition',
      price: 19,
      position: 1,
      url: 'https://www.example.com/product/path',
      image_url: 'https://www.example.com/product/path.jpg'
    },
    {
      product_id: '502bw76585ebp509fc183733',
      sku: '96493-35',
      name: 'Uno Card Game',
      price: 3,
      position: 2
    }
  ]
});

Last updated