Skip to main content
Fires when an order is completed. This is the most important e-commerce event — it’s used for conversion tracking, ROAS calculation, and optimization across all ad platforms.
Shopify: Automatically tracked on the order confirmation page (thank you page) and via server-side webhooks.

JavaScript

window._upstack('track', 'purchase', {
  orderId: 'ORD_12345',
  value: 149.99,
  currency: 'USD',
  tax: 12.50,
  shipping: 5.99,
  items: [
    {
      id: 'SKU_001',
      name: 'Blue Running Shoes',
      price: 89.99,
      quantity: 1,
      brand: 'Nike',
      category: 'Shoes/Running'
    },
    {
      id: 'SKU_002',
      name: 'Running Socks',
      price: 14.99,
      quantity: 2,
      brand: 'Nike',
      category: 'Accessories/Socks'
    }
  ],
  email: 'customer@example.com'
}, 'ORD_12345');
The third parameter ('ORD_12345') is a deduplication ID. It prevents duplicate purchase events from being sent to destinations if the event fires multiple times.
Minimal example:
window._upstack('track', 'purchase', {
  orderId: 'ORD_12345',
  value: 149.99,
  currency: 'USD',
  items: [{ id: 'SKU_001', name: 'Blue Running Shoes', price: 89.99, quantity: 1 }]
}, 'ORD_12345');

Properties

PropertyTypeRequiredDescription
orderIdstringYesUnique order identifier
valuenumberYesTotal order value
currencystringYesISO 4217 currency code
itemsarrayYesProducts purchased (see Item Object)
taxnumberNoTax amount
shippingnumberNoShipping cost
emailstringNoCustomer email (improves identity matching)
Important: The value property should match what you want reported to ad platforms. Discrepancies between Shopify order totals and reported CAPI revenue are the most common attribution debugging issue.

When to Fire

  • Order confirmation page load
  • After successful payment confirmation
  • Shopify orders/create webhook (server-side)