Send cart and purchase events
Once the widget is on your site, report cart activity with DICE.track. DICE uses it for abandoned cart recovery (only for customers with marketing consent) and to attribute sales to conversations.
DICE.track('cart.item_added', { cart_id: 'c_123', currency: 'CAD', item: { sku: 'DESK-1', name: 'Walnut desk', price: 420.0, quantity: 1 } });
DICE.track('checkout.started', { cart_id: 'c_123', checkout_url: 'https://shop.example/checkout/c_123' });
DICE.track('purchase', { cart_id: 'c_123', order_id: 'ORD-1001', total: 420.0, currency: 'CAD' });Amounts are in major units (dollars, euros, lira).
Events
| Event | When to send it |
|---|---|
cart.updated | The cart changed and you send the full list of items |
cart.item_added | One item was added |
cart.item_removed | One item was removed |
checkout.started | The shopper reached checkout |
purchase | The order was placed |
Good to know
- Send the same
cart_idyour store uses so events join up. Without one, DICE keeps one open cart per visitor. - A cart counts as abandoned after 30 minutes without activity (configurable in Automations → Cart recovery).
- Recovery messages go out only when the customer gave marketing consent, and stop at purchase.