Skip to content

Ecommerce tracking

Use goal names the dashboard already understands. Fire purchase on the thank-you page, not the checkout button.

Recommended goal names
When these names appear, the app dashboard shows a purchase journey and search/browse tables. Properties are flat strings and numbers only.
  • search — query, results_count
  • view_item_list — list_name
  • view_item — item_id, item_name, category, price
  • add_to_cart
  • begin_checkout
  • purchase — amount, currency, order_id. Aliases: purchase_completed.
HTML attributes
html
<form data-ed-goal="search" data-ed-goal-query="running shoes" data-ed-goal-results-count="24">
  <button type="submit">Search</button>
</form>

<button
  data-ed-goal="add_to_cart"
  data-ed-goal-item-id="sku_123"
  data-ed-goal-item-name="Trail Runner"
>
  Add to cart
</button>
JavaScript
Fire purchase after payment succeeds
javascript
window.eventDash.trackGoal('search', {
  query: 'running shoes',
  results_count: 24
})

window.eventDash.trackGoal('view_item', {
  item_id: 'sku_123',
  item_name: 'Trail Runner',
  category: 'shoes',
  price: 129
})

window.eventDash.trackGoal('purchase', {
  order_id: 'ord_12345',
  amount: 129,
  currency: 'USD'
})

Do not send nested line items. One purchase goal with the order total is enough for revenue and AOV on the dashboard.