Skip to Content
ReferenceAnalytics and consentStorefront analytics events

Storefront analytics events

Audience: Developer and Integrator.

This reference defines standard events and their delivery contract.

Events and data

Each event has id, name, type, timestamp, seq, context, source, and data. The current runtime emits standard events. IDs and sequence values belong to the current browser document. Delivery is not guaranteed. A delivery diagnostic does not prove that the vendor stored the event.

Context contains the page-view ID, actual domain, CMS page ID, locale, page title, public URL, and referrer. The runtime removes query strings and fragments. SPA navigation uses the previous public URL as the referrer. Query-only and fragment-only changes do not create a page view.

EventDataTrigger
page_viewedEmpty objectPublic CMS page becomes current.
product_viewedproductVariantProduct detail becomes current.
collection_viewedcollection: { id, title }Successful product archive view has one selected collection.
cart_viewedlines, totalCart view becomes current.
product_added_to_cartcartLineConfirmed mutation increases quantity.
product_removed_from_cartcartLineConfirmed mutation decreases quantity.
search_submittedsource, resultCountUser submits search. Search text is excluded.
form_submittedformIdContact form API request succeeds. Entered values are excluded.
checkout_link_clickedtotalUser activates an enabled checkout link.

A variant has id, title, sku, price, and product: { id, title }. Money uses { amount: string, currencyCode: string }. Cart lines have id, quantity, and merchandise, which uses the variant shape. Cart keys, checkout URLs, buyer identity, and complete Shopify response objects are excluded.

The runtime removes duplicate current views within a page view. Late subscribers and later consent grants receive updated snapshots of current views. The runtime delivers action events only to active subscribers. It never stores these events for later delivery. Actions from a disabled period therefore do not replay when the integration is enabled again.

Cart events use confirmed responses before loyalty reconciliation. Cart refresh, discounts, and loyalty updates do not create add-to-cart events. The cart write queue protects simultaneous first additions independently of analytics. Tracking failures cannot reject confirmed cart changes.

Admin, development, unpublished, and draft-preview routes do not start the managed storefront runtime.

Delivery conditions

The loader omits cross-origin credentials and referrer information. The API’s configured CORS origins control cross-origin loads. Setup starts only while the integration stays selected and consent permits it. Consent removal cancels setup that is still downloading. Current views replay after setup. The runtime does not buffer actions that occur before setup.

Use the integration API to subscribe to these events. Use the runtime explanation for checkout and vendor boundaries.

Last updated on