First-party attribution for Shopify
Shopify gives you checkout webhooks and a theme you can edit — everything you need for a server-confirmed purchase event. What it does not give you is a durable visitor id or a journey that spans the pre-checkout browsing.
Durable id (server-set) + client events (behaviour) + server events (truth) + dedup key
Snippet in theme.liquid + an orders/paid webhook for the server-side confirmation. The one decision that matters on Shopify: who writes the visitor id. Written by JavaScript it lives 7 days in Safari; written by a server it lasts as long as you set it.
Put the snippet in `layout/theme.liquid` just before `</head>` so it runs before app scripts.
What Shopify gives you for free
Every stack has a natural advantage for first-party measurement. Use it before reaching for a tag manager.
Orders webhook is an authoritative, server-side source of truth
Order id is a natural de-duplication key
Customer email is captured at checkout, which closes the anonymous-to-known gap
What breaks on Shopify
The failure modes specific to this stack — the ones a generic install guide will not warn you about.
Checkout is on a different origin
On non-Plus plans the checkout runs on shopify.com domains, so any storage written on your store domain is not readable there.
Fix Pass the visitor id into the order as a cart attribute or note, and let the webhook carry it back.
Theme app extensions load late
Tags injected by apps often fire after the first paint, missing the landing referrer entirely.
Fix Capture the landing URL and click ids on the very first request, before any app script runs.
Shopify's own analytics is last-click
Shopify's acquisition reports use its own model and will not agree with your ad platforms or your first-party data.
Fix Pick one ledger for decisions. Use the others for their own optimisation.
Frequently asked questions
How do I track Shopify conversions server-side?
Subscribe to the `orders/paid` webhook, and send a purchase event to your attribution API with the order id as the de-duplication key. The webhook fires from Shopify's servers, so ad blockers and ITP are irrelevant to it.
How do I connect browsing to a Shopify order?
Carry the visitor id into the cart as a cart attribute, and read it back off the order in the webhook. That is the join between the anonymous session and the paid order.
Does this work on Shopify checkout extensibility?
Yes — the webhook path is unaffected. Client-side pixels in checkout are increasingly restricted, which is precisely why the server-side confirmation is the durable option.
Will this slow down my store?
The snippet is a few KB and posts asynchronously with sendBeacon. The webhook runs on Shopify's side and never touches the shopper's page.
Related guides
See the receipt for every conversion.
Flowsk Signals stitches the anonymous click to the email to the purchase — first-party, server-side, de-duplicated on a key you choose. One snippet, $29/mo, and a journey you can inspect event by event.
More free tools
Same deal — instant, no signup.