Guides
Analytics events
Send shopper activity so it appears in the merchant's Storepecker analytics, like visits to their own website.
POST /v1/events → 202 Accepted
{ "type": "page_view", "visitor_id": "4f9c2e1a-…", "path": "/shop/blue-mug-large",
"referrer": "https://instagram.com/", "utm": { "source": "instagram", "campaign": "diwali" } }
{ "type": "add_to_cart", "visitor_id": "4f9c2e1a-…", "variant_id": "var_…", "quantity": 2, "value": 99800 }
| Field | Meaning |
|---|---|
type | page_view, add_to_cart, remove_from_cart, checkout_started, address_entered, shipping_selected, payment_selected, payment_initiated |
visitor_id | Your stable anonymous ID for the visitor (a UUID in a first-party cookie); letters, digits and dashes, up to 50 |
path | Required for page_view. Use /shop/{variant_slug} for product pages so they count as product views |
referrer, utm, click_ids | Optional campaign attribution (utm keys: source, medium, campaign, term, content) |
variant_id, quantity, value | For cart events; value in the smallest currency unit |
From your server, send the shopper's X-Buyer-IP and X-Buyer-User-Agent (see Keys and security); bots and crawlers are dropped automatically.