Event types
The public SDK accepts three cart-authorized interaction events. Crave recordsORDER_PLACED
server-side only after payment succeeds and the order is created, so clients cannot forge a
conversion.
Track events with the SDK
{ "status": "accepted" } after it authorizes the cart and records or deduplicates
the event.
Where to fire events
Place analytics calls at these points in your storefront:ORDER_PLACED from a browser or mobile client. Poll the authoritative order result for
the UI; the API writes the conversion event during server-side order creation.
Custom metadata
Themetadata field accepts any key-value pairs. Use it to attach context to events:
Google Analytics integration
Forward Crave events to Google Analytics for unified reporting:checkout.getOrderResult() returns completed; do not forward that event to the Crave public
analytics endpoint.
View analytics in the Dashboard
Analytics data is available in the Crave Dashboard under Analytics > Storefront. The dashboard shows:- Funnel visualization — conversion rates between each stage
- Event timeline — raw event stream with metadata
- Location comparison — performance across multiple locations
- Time-based trends — daily, weekly, and monthly patterns
Best practices
- Fire events once — deduplicate using a ref or flag to prevent double-counting on re-renders
- Don’t block the UI — fire analytics calls without
awaitto keep the interface responsive - Include metadata — the more context you attach, the more useful your Dashboard reports
- Test outside production first — confirm events appear in the intended Dashboard environment
Next steps
Order Tracking
Track order status after checkout.
Deployment
Deploy your storefront and go live.