Skip to main content
The app registers a Shopify app proxy that maps the public storefront path /apps/live-view/* to the app’s internal proxy routes. Requests arrive from Shopify HMAC-signed — the signature covers the query parameters, including the shop domain. Nothing is trusted before signature verification. There are exactly two endpoints: Rate limits use a fixed in-memory window keyed on the signature-verified shop domain — never on client-controlled headers. All responses are sent with Cache-Control: no-store.

POST /apps/live-view/track

Ingests a batch of tracker events.
  • Query: shop (the store’s myshopify.com domain, format-validated before authentication).
  • Body: JSON, maximum 64 KB, of the form { "events": [ ... ] } with at most 25 events ingested per batch. A legacy single-event payload shape is also accepted for compatibility.
  • Response: { "accepted": <n> } — the number of events that passed validation and were recorded.

Event fields

Every event carries sid (the anonymous session UUID) and product identity: pid (numeric product id) or handle (product slug, lowercase, up to 120 characters). Validation is strict: Handle-only events resolve against the product cache per batch. Malformed events are dropped silently — the rest of the batch still ingests and the request never fails the storefront.
A view event is only recorded once per shop + session + product inside the configured dedupe window (default 30 minutes). Heartbeats refresh presence instead of creating events.

GET /apps/live-view/stats

Returns the live count the counter block renders.
  • Query: shop plus exactly one product identifier — productId (1–24 digits) or handle (slug). Anything else is a 400.
  • Response:
  • count is the number of distinct sessions with a heartbeat inside the presence window (activeWindowSeconds, default 60 s).
  • visible is false — and the widget hides itself — when tracking is disabled for the shop, the product cannot be resolved, the product’s counter is individually disabled, or count is below the minimum-views threshold. The endpoint never fabricates a count.

Authentication

  1. Shop format check (pre-auth): the shop parameter must look like a valid myshopify.com domain, or the request is rejected with 400 before any signature work.
  2. Proxy signature verification: Shopify’s HMAC signature over the query parameters is verified by the app library. Missing or tampered signatures are rejected with 400/401.
  3. Installation check: the verified shop must have an installed session in the app; otherwise 403.
  4. Rate limit: per verified shop, per the table above; over-limit requests get 429.

Error responses

These endpoints are for the theme extension. Do not build custom callers against them: payloads are validated strictly, unsigned requests are always rejected, and the wire format may change. Integration points for merchants are the theme blocks and the admin app.