Shopify gives you three places to run tracking code, and they do not have the same power. Confusing them is the most common reason a Shopify migration takes two weeks instead of two days.
The three places: the theme, the web pixel, and the checkout.
The theme is yours. The checkout is not. The web pixel is somewhere in between, and that in-between is where people get stuck.
What the web pixel actually is
A web pixel is a sandboxed app surface that subscribes to a fixed list of customer events. You register it, Shopify calls your function with an event payload, and you decide what to do with it.
The useful part: it sees checkout events on any plan, including Basic. Without it, a standard plan has no way to observe what happens after the customer taps into checkout.
The part people miss: it is an app surface, not a script tag. It does not have the page.
What it will not let you do
Four things, all of which get assumed at some point during a migration.
Read the DOM. There is no document. You cannot query an element, read a form field, or scrape a value out of the page. A pixel cannot find the order total by looking at the confirmation screen; it has to receive it in the event payload.
Run arbitrary network calls. Destinations are constrained. You cannot post to any URL you like, which means a custom endpoint has to be reached another way.
Persist state between sessions. The sandbox gives limited storage, and it is not a durable store for identifiers. Anything you need to keep has to live outside it.
See pre-checkout behaviour beyond what is emitted. If the event is not in Shopify's list, the pixel does not know it happened.
That first one has a consequence worth stating plainly. You cannot capture a click identifier from inside the sandbox, because reading the URL requires the page. So the identifier has to be captured by theme-level code on the landing page, before checkout, in a place the sandbox can later read from. Which is another thing the sandbox limits.
The workable pattern is: theme code captures on landing, the pixel reads the value out of the event context if Shopify exposes it, and your server receives both.
The checkout constraint, stated once
On a standard Shopify plan you cannot run your own JavaScript inside checkout. checkout.liquid is a Shopify Plus feature. This is not a limitation you can engineer around with a clever app.
So the purchase event has exactly two viable sources on a non-Plus store:
- A web pixel subscription to checkout completion, which fires from the browser.
- An order webhook, which fires from Shopify to your server.
For a prepaid store, the first is fine and gives you faster feedback. For a cash-on-delivery store, only the second works, because the customer may never load a confirmation page at all.
That is the whole architecture decision on Shopify, and everything else is plumbing.
The theme change that silently kills tracking
This one costs more money than any other item on the page.
Your snippets live in theme.liquid. A new theme does not carry them. When you publish a new theme, tracking stops.
Nothing looks broken. The store loads, orders arrive, Shopify admin shows everything correctly. You find out a week later when the ad platform reports a conversion collapse, and by then you have spent a week's budget optimising on no data.
Two habits prevent it. After every theme publish, load the storefront and confirm the tracker script is in the page source. And put that check in the launch checklist before the theme goes live, not after.
I would go further: write the snippet placement into your theme's README or a pinned note in whatever tool your team uses. Future-you will not remember.
Migration order that avoids double counting
If a store is currently running only the Meta pixel through a Shopify app:
- Install the theme snippets and verify click-ID capture on a real ad click.
- Add the container and configure the destination.
- Turn on server purchase from the order webhook.
- Keep the browser pixel for PageView, ViewContent and AddToCart.
- Retire the browser purchase only after one clean test order shows a single event in Events Manager.
Steps 3 and 5 out of order is where duplicate purchases appear. Doing them in order is boring and it works.
What to measure afterwards
Three numbers, tracked weekly against a baseline from before the migration:
The gap between platform-reported purchases and Shopify orders. It should narrow, not close. A gap that closes to zero usually means you are now under-reporting.
The share of events carrying a click identifier. This should rise as capture starts surviving the checkout boundary.
Reported ROAS. Worth watching, but it moves for reasons that have nothing to do with tracking, so do not treat it as a verification signal.
The honest summary
Shopify's restrictions are real and they are not going away. A standard plan will never let you run code in checkout, and the web pixel will never give you the DOM.
That is fine. You do not need either. You need the click identifier captured on landing, the purchase fired from an order webhook on confirmation, and one path only so nothing double counts.
The stores that struggle are the ones that try to make the sandbox do something it was designed not to do. The stores that ship in a day accept the boundary and put the code where it belongs.
Frequently asked questions
Can the web pixel read the order total off the confirmation screen?
No. There is no DOM access, so it cannot query an element or scrape a value. It receives whatever Shopify puts in the event payload.
Is checkout.liquid available on my plan?
Only on Shopify Plus. On a standard plan there is no way to run your own JavaScript inside checkout, and no app changes that.
Why did tracking stop after I published a new theme?
The snippets live in theme.liquid, and a new theme does not carry them. Re-add and verify after any theme change.
Which purchase path works for cash on delivery?
The order webhook. The customer may never load a confirmation page, so a browser-side purchase signal has nothing to watch.
Do I still need the browser pixel?
For PageView, ViewContent and AddToCart, usually yes. Only the browser purchase event is worth retiring, and only after one clean test order shows a single conversion.
Related in this cluster
- cod order tracking — the cluster hub, start here
- cod order tracking meta ads
- shopify server side tracking
- meta capi setup bangladesh — next cluster over
Practical next steps: COD order tracking · how the event path works · plans in BDT
Compare the BonicBD feature set, review the setup guide, or contact the team if you want help with a live server-side GTM rollout.