Skip to content

Shopify

On a Shopify storefront the tracker works like anywhere else, with one extra job: Shopify’s checkout and web pixels run in sandboxes that cannot see window.signals, so the session id has to be carried into the order explicitly. The cart is the carrier.

Customer browses -> signals.js tracks the session
Cart bridge -> stashes the session id as a cart attribute
Customer buys -> the id rides the order's note_attributes through checkout
orders/paid webhook -> SnipForm writes the order value onto that session

Add shopify=true to the script URL:

<script src="https://cdn.snipform.io/api/analytics/signals.js?site=YOUR_PROPERTY_KEY&shopify=true" defer></script>

Once the session is ready the tracker:

  1. POSTs /cart/update.js with { attributes: { _snip_sid: "<session id>" } }, setting the attribute on the cart.
  2. Appends a hidden properties[_snip_sid] input to every form[action^="/cart/add"], so items added from then on carry the id as a line-item property.
  3. Watches the DOM and repeats step 2 for add-to-cart forms rendered later (quick-view modals, sticky bars, infinite scroll).

The bridge runs once per page load. debug=true adds [Signals:shopify] console lines showing the cart response and how many forms were stamped.

  1. Install the SnipForm app and link the shop to your property. See Shopify integration.

  2. Add the storefront script: enable the SnipForm Signals app embed in the theme editor (Theme settings → App embeds) and paste the property key, or add the script tag above to theme.liquid yourself. Both do the same thing; the embed is the tag plus shopify=true.

  3. Add the customer events pixel from the integration page (Settings → Customer events in Shopify admin). Checkout runs in a sandbox the tracker cannot enter; the pixel is what reports add_to_cart, checkout and purchase events from inside it, reading the session id off the cart the bridge stamped.

  4. Place a test order. The session in the dashboard shows the funnel events and, once orders/paid arrives, the order value.

SourceEffect on the session
Pixel product_added_to_cartAn add_to_cart event with the line value and currency
Pixel checkout_startedA checkout event with the checkout total and item summary
Webhook checkouts/createA checkout step server-side even if the pixel was blocked
Webhook orders/paidAn acquisition with the order total and currency, tagged with the order id

The pixel’s event set is configurable on the integration page; all three are on by default. The order tag makes the revenue write idempotent: a second delivery of the same webhook updates the same acquisition rather than doubling revenue. The session’s value appears under acquisition_value and value_usd, with value_source set to shopify.

The integration page offers a one-click Shopify Sales conversion, published and ready: All traffic → Added to cart (add_to_cart event) → Checkout (checkout event) → Purchase (session has acquisition value), with the conversion’s value summed from order revenue. Build your own on top of the same events if you want a different shape. See Conversions.

Express checkouts that skip the cart (Buy It Now, Shop Pay express buttons) never touch the cart attribute, so those orders are not attributed to a session. Normal add-to-cart-then-checkout flows are unaffected.