Shopify

How to set up Meta Pixel on Shopify in 2026 (the right way)

The old method of installing Meta Pixel on Shopify - pasting a snippet into your theme - creates duplicate events and inaccurate data. The correct method uses Shopify's native Facebook & Instagram channel. Here's how to do it correctly and what to verify afterwards.

Setting up Meta Pixel incorrectly on Shopify is more common than setting it up correctly. The symptom: you have a Pixel in Events Manager, events are firing, but your data is duplicated, your reported purchase value is wrong, or your Conversions API and browser Pixel are both firing for the same event. Here's how to avoid all of that.

Why manual theme snippets cause problems

The old way of installing Meta Pixel involved copying a JavaScript snippet from Meta Events Manager and pasting it into your Shopify theme's theme.liquid file. This worked when Shopify's checkout was fully theme-controlled.

Today it creates two problems. First, the snippet can't fire on Shopify's hosted checkout pages - which means it misses purchase events, the most important conversion signal. Second, if you then install the Facebook & Instagram channel (which uses Shopify's Customer Events system), you end up with both a manual snippet and a Customer Events pixel firing simultaneously - producing duplicate PageView and ViewContent events that corrupt your reporting and your ad attribution.

If you have a manual Pixel snippet in your theme, remove it before proceeding.

The correct method: Facebook & Instagram channel

  1. In Shopify admin, go to Settings → Apps and sales channels
  2. Search for and install "Facebook & Instagram" from the Shopify App Store (it's free)
  3. Open the Facebook & Instagram channel and click "Start setup"
  4. Connect your Facebook Business Manager account and select the Facebook Page for your brand
  5. Under "Data sharing", connect your Meta Pixel and enable the Conversions API
  6. Set data sharing to "Maximum" - this enables server-side event matching which improves signal quality under iOS 14+ restrictions

Once connected, Shopify sends pixel events via both browser JavaScript (client-side) and the Conversions API (server-side). Shopify deduplicates these automatically so Meta receives the event once, not twice.

The Conversions API: why it matters

iOS 14 and subsequent privacy changes reduced the reliability of browser-side pixel tracking. Users who opt out of tracking on iOS don't fire browser pixel events at all. The Conversions API sends event data directly from Shopify's servers to Meta - bypassing browser-level blocking.

Enabling the Conversions API (available through the "Maximum" data sharing setting in the Facebook & Instagram channel) recovers a portion of the purchase events that browser-side tracking loses. This makes your reported ROAS more accurate and gives Meta's algorithm better purchase signal to optimise against.

Verifying the setup is working

After connecting, verify in Meta Events Manager:

  • Go to Events Manager → your Pixel → Test Events
  • Enter your Shopify store URL and click "Open website"
  • Browse to a product page. You should see ViewContent fire in the test events panel
  • Add a product to cart. AddToCart should fire
  • Place a test order. Purchase should fire with the correct order value

Also check the Event Match Quality score in Events Manager. A score above 7/10 indicates your customer data (email, phone) is being matched against Meta's database effectively, which improves ad targeting accuracy.

Common issues after setup

Duplicate events. If you see two PageView events per page load in Events Manager, you have both a manual snippet and the Customer Events pixel active. Find and remove the manual snippet from your theme - it's usually in theme.liquid inside the <head> section.

Missing purchase events. If AddToCart fires but Purchase doesn't, the Conversions API may not be configured correctly, or there's a mismatch in your event deduplication setup. Check the Facebook & Instagram channel settings in Shopify and ensure the Pixel ID and API token match what's in your Meta Business Manager.

Incorrect purchase value. If reported purchase value in Events Manager doesn't match your Shopify order values, check whether you're sending the value inclusive or exclusive of tax. Shopify sends the total including tax by default - verify this matches your Meta campaign reporting settings.

Events firing on the wrong domain. If your Shopify store uses a custom domain, make sure it's verified in Meta Business Manager under Events Manager → your Pixel → Settings → Domains. Unverified domains cause event signal quality issues and can prevent conversion tracking from attributing correctly.

Filip Rastovic
Filip Rastovic
Shopify Developer & CRO Specialist · Stargazer Studio

Need tracking set up correctly on your Shopify store?

Book a free call. I can include Meta Pixel, GA4, and Conversions API configuration as part of a build or as a standalone engagement.

Book a free call More articles
Filip Rastovic
Book a Call Get started today