Clicks & Carts

Setting up the Meta pixel and conversion tracking on Shopify

Install it through the sales channel, not by pasting code. Then verify the purchase event, because that is the one that is always wrong.

7 min read · Store setup ·

The Meta pixel tracks what visitors do on your store so ad campaigns can optimise and report. On Shopify, install it through the official channel — not by pasting code into your theme, which is how stores end up with duplicate events and a broken checkout funnel.

Install it the supported way

Connect Meta as a sales channel in Shopify and link your pixel there. That gets you:

  • The pixel on every storefront page, without theme edits.
  • Checkout events, which you cannot get by pasting code into a theme — checkout is Shopify's, and script tags there stopped being possible under checkout extensibility.
  • Product catalogue sync for dynamic ads.
  • Survives theme changes and updates.

Pasting the pixel into theme.liquid gets you page views and nothing after add-to-cart. That's the version most stores have and it's why their reporting looks wrong.

Web Pixels, not script tags

Analytics and marketing tags in checkout now load through Shopify's sandboxed Web Pixels API. That's both the supported route and a performance improvement — they can't block or break checkout.

If you have raw script tags in checkout from an older setup, that's a migration you're overdue on. It also means anything running in checkout no longer has arbitrary DOM access, which surprises people migrating custom tracking.

The Conversions API

Browser-based tracking loses events — ad blockers, tracking prevention, network failures. The Conversions API sends events server-side from Shopify to Meta, which fills a substantial portion of that gap.

Enable it alongside the pixel, not instead of it. Both together, with event deduplication handled by matching event IDs, is the current standard setup. Running only the browser pixel means under-reporting conversions and worse campaign optimisation.

If you serve regions requiring consent before non-essential tracking, the pixel must not fire until consent is given. Shopify has native consent tooling, and the Meta channel respects it when configured.

Test it properly: open the store in a private window, decline, and check in the browser's network tab that no requests go to Meta. A consent banner that informs people while everything fires anyway is worse than no banner — it's a compliance problem you've documented.

And list Meta in your privacy policy by name, as a recipient of customer data.

Verify the events

The step everyone skips, and the purchase event is the one that's always wrong.

Use Meta's Events Manager test tool and walk the funnel yourself:

  1. PageView on any page.
  2. ViewContent on a product page — with the correct product ID and value.
  3. AddToCart.
  4. InitiateCheckout.
  5. Purchase — with the correct value and currency.

Check the value and currency on Purchase specifically. A purchase event reporting the wrong amount, or reporting in the wrong currency in a multi-currency store, makes every ROAS figure you look at fiction.

Don't install it twice

The most common problem I find. A store has the pixel via the Meta channel, and pasted in the theme, and in a tag manager, and in an SEO app.

Duplicate events inflate conversions, mislead the algorithm and waste budget. Check the rendered page for how many times the pixel ID appears, and remove all but one.

Performance

Every tracking script costs main-thread time, which is INP. The pixel is comparatively light, but it stacks with everything else — JavaScript and third-party scripts.

Two rules: don't run two tag managers, and audit tracking scripts on the same schedule as your apps.

Other platforms, same shape

TikTok, Pinterest, Snap and Google all follow the same pattern on Shopify: install through the official sales channel, enable the server-side API where offered, respect consent, verify the purchase event.

The advice is identical. So is the failure mode — installed twice, purchase event never checked.

Install through the channel, enable the Conversions API, gate it behind consent, and verify the purchase event carries the right value. Most tracking problems are one of those four.

Is this the problem you’re looking at?

Send me the link to your store and a line about what is going wrong. You get a straight answer within one business day — no pitch, no obligation.

mario@clicksandcarts.co

Or see what I do around Shopify: services, work beyond the theme, selected work.

Keep reading

← All articles