Integrations / Analytics & tracking

How to Set Up GA4 and the Meta Pixel on Shopify Correctly

Almost every store we audit has tracking installed. A large share of them are double-counting purchases, which makes every decision downstream of that data wrong.

  • Steps8
  • Time2 hrs
  • DifficultyNo code required

WHY THIS MATTERS

You cannot optimise what you measure incorrectly, and broken tracking is worse than none because it looks authoritative. The classic failure is installing the Meta Pixel through Shopify's native channel and again through a theme snippet, so every purchase fires twice and your reported ROAS is double the real one. The second failure is skipping the Conversions API, which increasingly matters as browser tracking degrades. Once this is right, use the break-even ROAS calculator to find the return you actually need to clear.

Before you start

  • A GA4 property
  • A Meta business account and pixel
  • A Shopify store
  • Somewhere to record what you installed

Step by step

The same sequence we follow on client stores. Do them in order — several of the later steps depend on decisions made in the earlier ones.

  1. Remove what is already there

    Before installing anything, find every existing tag: theme code, the Shopify apps channel, additional scripts, and any app that adds its own. Remove the duplicates. This is the step that fixes most stores.

  2. Connect GA4 through Shopify's Google channel

    Use the official Google & YouTube channel rather than pasting a gtag snippet into your theme. It handles the ecommerce events natively and survives theme updates, which hand-placed snippets do not.

  3. Install the Meta Pixel through the Facebook channel

    Same principle: install through Shopify's Facebook & Instagram channel and let it own the pixel. If a theme snippet is also firing, you now have two pixels and no reliable numbers.

  4. Enable the Conversions API

    Turn on server-side event sharing in the Facebook channel and set the data-sharing level. As browser-based tracking keeps degrading, the server-side signal is what keeps attribution usable.

  5. Configure consent before you collect

    Set up Shopify's customer privacy and consent settings for the regions you sell into. If you sell into Europe, consent mode is a legal requirement, not a preference — and retrofitting it is harder than doing it now.

  6. Verify with the real debug tools

    Use GA4 DebugView and Meta Events Manager's Test Events, and place a real test order. Confirm exactly one purchase event fires, with the correct value and currency. This is a five-minute check that most stores have never done.

  7. Reconcile against Shopify's own numbers

    Compare a week of GA4 and Meta purchases against Shopify Analytics. They will never match perfectly — attribution windows differ — but a gap of two times means something is broken, not nuanced.

  8. Write down what you installed and where

    A short note of every tag, where it lives, and who owns it. The next person to touch the theme, including future you, will otherwise add a duplicate.

What we do differently

The three things that separate a working setup from a default one — drawn from the stores we ship, not from the documentation.

Audit before you install

Most tracking problems are duplicates, not gaps.

Use the official channels

Theme snippets do not survive theme updates. Channels do.

Reconcile against Shopify

A 2x discrepancy is a bug, not an attribution window.

Would rather we just did it?

We set this up on every store we build, and we do it as standalone work too. Start with a free audit — we will tell you what is worth changing before you spend anything.

Frequently Asked
Questions

What clients ask us about this integration before we set it up.

Why do GA4 and Shopify report different revenue?

Some difference is normal — attribution models, ad blockers, and consent all cause drift. A large or doubling gap is a tracking fault, most often duplicate events.

Do I need Google Tag Manager?

Usually not on Shopify. The native channels cover ecommerce events well, and GTM adds a layer of complexity that mostly earns its place on bespoke tracking requirements.

Is the Conversions API worth setting up?

Yes. Browser-side tracking continues to degrade, and server-side events are what keeps your campaign attribution from getting worse over time.

Can you check our tracking?

Yes — duplicate-event detection is part of our store audit, and it is usually the fastest fix we find.