Event types
The SDK supports four funnel events:| Event | When to fire | Funnel stage |
|---|---|---|
SCAN | Customer scans a QR code or visits the storefront URL | Entry |
CART_VIEW | Customer opens the cart panel | Consideration |
CHECKOUT_VIEW | Customer reaches the checkout page | Intent |
ORDER_PLACED | Payment succeeds and order is created | Conversion |
Track events with the SDK
{ "status": "accepted" } on success. Events are processed asynchronously.
Where to fire events
Place analytics calls at these points in your storefront: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: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 in test mode — test API keys still record analytics events, visible in the Dashboard
Next steps
Order Tracking
Track order status after checkout.
Deployment
Deploy your storefront and go live.