Ecommerce tracking
Use goal names the dashboard already understands. Fire purchase on the thank-you page, not the checkout button.
Goals, not custom events
Store events must be
trackGoal() or data-ed-goal. Custom track() events are Standard+ and do not count as conversions or funnel goal steps.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_countview_item_list— list_nameview_item— item_id, item_name, category, priceadd_to_cartbegin_checkoutpurchase— 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.
Related