Skip to main content
Fires when a visitor adds an item to their cart. This is one of the most important e-commerce events for tracking purchase intent and building audiences.
Shopify: Automatically tracked when using standard Shopify cart functionality.

JavaScript

window._upstack('track', 'add_to_cart', {
  items: [
    {
      id: 'SKU_12345',
      name: 'Classic Cotton Tee',
      price: 34.99,
      quantity: 2,
      variant: 'Blue / Medium',
      brand: 'Example Brand',
      category: 'Apparel/T-Shirts'
    }
  ],
  value: 69.98,
  currency: 'USD'
});
Minimal example:
window._upstack('track', 'add_to_cart', {
  items: [{ id: 'SKU_12345', name: 'Classic Cotton Tee', price: 34.99, quantity: 1 }],
  value: 34.99,
  currency: 'USD'
});

Properties

PropertyTypeRequiredDescription
itemsarrayYesProducts added (see Item Object)
valuenumberYesTotal value of items added
currencystringYesISO 4217 currency code

When to Fire

  • Add-to-cart button click
  • Quantity increase in cart
  • “Buy Now” button click (before checkout)