عربي
← All articles
MEDIA BUYING · 5 min read

How do I set up GA4 and the Meta pixel correctly for a Shopify store?

·

Short answer: connect GA4 through Shopify's Google & YouTube app and the Meta pixel through the Facebook & Instagram app, and install each one in one place only. Then place a test order and watch it arrive in Meta's Test Events and in GA4 Realtime. After a week, compare the purchases each tool reports with the orders in Shopify. If a platform shows far more purchases than you have orders, something is counted twice; if it shows far fewer, the purchase event is missing.

Why this matters more than it looks

Meta and Google optimise toward the purchases you send them. If every order arrives twice, the ad platform thinks your ads work better than they do, and it learns from sales that never happened. If purchases don't arrive at all, it has nothing to learn from. Either way you make budget decisions on the wrong numbers.

The most common problem I find in Shopify stores isn't a missing pixel. It's the same pixel installed two or three times over the years: once in the theme code, once by an app, and once by a freelancer in Google Tag Manager or a custom pixel.

The setup I use

Step What to do How to check
1. Inventory List every place a tag might live: Settings → Customer events (app pixels and custom pixels), the theme code, Google Tag Manager, old apps Write it down; each platform should appear once
2. GA4 Connect through the Google & YouTube app with your GA4 property GA4 → Realtime shows your visit and the purchase
3. Meta Connect through the Facebook & Instagram app, with your own Business account and pixel, and the highest data-sharing level you're comfortable with Events Manager → Test events shows PageView, AddToCart and Purchase once each
4. Remove duplicates Delete old pixel code from the theme and any custom pixel that sends the same events Repeat the test order; each event appears once
5. Currency and value Purchase value in the store's currency, matching what Shopify reports Compare the test order's value in each tool
6. A week later Compare purchases in Meta and GA4 with Shopify orders for the same 7 days Small gaps are normal; a 2× gap is not

Some gap is always normal: visitors who decline cookies, ad blockers, and the fact that each platform uses its own attribution. What you're looking for is a gap that doesn't make sense.

An example

Say a store had 31 orders in Shopify last week, and Ads Manager shows 62 purchases. Exactly double is a strong sign of a duplicate: often the Meta app plus an older custom pixel or tag sending the same Purchase event. After removing one, the numbers should land closer to the store's real orders, and Meta's cost per purchase will look worse on paper, because it's now closer to the truth.

Common mistakes

  • Installing the pixel "to be safe" in several places. Two installs don't make tracking more reliable; they double-count.
  • Relying on old checkout scripts. On stores moved to Shopify's newer checkout, the old "additional scripts" box on the order status page no longer runs, so purchase tracking that lived there can stop silently.
  • Counting the same conversion twice in Google Ads. If you import purchases from GA4 and also use another Google Ads purchase tag, set only one as the primary conversion.
  • Wrong currency. A store priced in SAR reporting values as USD (or the reverse) makes every ROAS number wrong.
  • Never testing after a change. A new theme, a new app or a checkout change can break tracking. Test with one order every time.
  • Judging COD stores by the dashboard alone. With cash on delivery, a tracked purchase can still be refused at the door. Compare with delivered orders too.

What I'd do in your place

  • Spend 20 minutes on the inventory: find every place a tag lives.
  • Keep one official connection per platform and remove the rest.
  • Place a test order and check it arrives once, with the right value, in each tool.
  • Put a weekly reminder to compare platform purchases with Shopify orders.

Questions people also ask

  • Do I still need Google Tag Manager on Shopify? Not for the basics. The official apps cover GA4 and the Meta pixel; GTM helps when you need custom events.
  • Do I need the Meta Conversions API? It helps recover purchases the browser misses; the Facebook & Instagram app can send server events for you.
  • Why don't Meta, GA4 and Shopify ever match exactly? Different attribution, cookie consent and ad blockers. Look for gaps that don't make sense, not a perfect match.
  • How often should I check? After every change to the theme, apps or checkout, and once a week.

Not sure your tracking is right? The store & ads audit checks it along with the rest of your setup, or book a free call first.

Ready to grow your brand?

Book a free 20-minute discovery call, or ask my AI assistant a quick question first.

Book a free call →