Fix guide · Shopify · easy · about 20 min
Duplicate Meta Pixel events on Shopify
For the finding “Duplicate Meta events”. Also for: Any website, WordPress, Webflow, Framer.
What this means
The same event (for example PageView or AddToCart) was sent twice for the same pixel ID within about a second, or the same pixel was set up twice on the page. On Shopify, this nearly always means the Meta Pixel (still often called the Facebook Pixel) is installed in two places. Shopify’s own help warns about the most common case: if you connect a pixel through Meta’s Facebook & Instagram app and do not remove pixel code added to your theme earlier, your store has more than one pixel, which can result in duplicate or incorrect data.
Why it costs you money:
- Meta counts some conversions twice (double-counting), so your reports look better than reality and your cost per result looks lower than it is.
- Meta’s optimization learns from inflated data and may spend budget on the wrong people.
This is about two identical browser events. A browser event plus a server (Conversions API) event for the same action is expected: with the Enhanced or Maximum data sharing level, the Facebook & Instagram app also sends purchases from Shopify’s servers, and Meta merges the pair when both carry the same event ID.
How to confirm it yourself
Our check runs from a browser in the EU and accepts the cookie banner before looking for duplicates.
- Open your store in a private (incognito) window, open developer tools (F12), go to Network and filter by
facebook.com/tr. - Accept cookies.
- In each request’s payload,
idis the pixel ID andevis the event name. Two requests with the sameidand the sameevat almost the same moment are a duplicate. Differentidvalues mean two different pixels, which is a separate question. - To see where each copy comes from, compare the
dlfield (the page address the pixel reports). If it contains/web-pixels@and/sandbox/, that copy is a custom pixel. If it shows your normal page address, the copy runs on the page itself: the Facebook & Instagram app, your theme, an app embed or GTM loaded by the theme. - Repeat on a product page (
ViewContent) and after adding a product to the cart (AddToCart). The Facebook & Instagram app tracksPageView,ViewContent,Search,AddToCart,InitiateCheckout,AddPaymentInfoandPurchase, so each of these should appear once per pixel ID.
Meta Ads Data Advisor (Meta’s Chrome extension, formerly Meta Pixel Helper) reports “Duplicate Pixel code” as a common setup error, and the Test events tool in Meta Events Manager (Data sources > your pixel > Test events) shows the event twice.
How to fix
To fix duplicate events or double-counting on Shopify, keep exactly one installation per pixel ID and remove the rest.
-
List every place a Shopify store can load the pixel:
- Sales channels > Facebook & Instagram: under Settings > Data sharing settings, whether customer data sharing is on and which pixel is connected.
- Settings > Customer events: other app pixels that send Meta events (marketing apps and Conversions API tools often include a browser pixel), and every custom pixel (look for
fbqor your pixel ID in its code). - Theme code: go to Online Store, open the menu of your current theme, click Edit code, open
theme.liquidand search forfbevents.jsandfbq(. Check the snippets it includes too. - App embeds: Online Store > Edit theme > App embeds icon.
- Google Tag Manager: Meta Pixel tags and Custom HTML tags with
fbq. GTM itself can also be installed twice (intheme.liquidand as a custom pixel); then every tag fires twice.
-
Keep one installation. For most stores this is the Facebook & Instagram app’s pixel: it covers storefront and checkout events, follows your customer privacy settings, and adds the Conversions API on the Enhanced or Maximum level. Then:
- delete the Meta pixel code from
theme.liquidand click Save; - disconnect custom pixels that send Meta events for the same pixel ID (Disconnect keeps the code, so you can delete it later);
- remove Meta tags from GTM;
- turn off app embeds or app settings that add another Meta pixel.
If you would rather keep a custom pixel or another app, turn off customer data sharing in the Facebook & Instagram app’s data sharing settings instead, so that only one copy sends browser events.
- delete the Meta pixel code from
-
Check purchase tracking added during the checkout upgrade. Shopify has retired Additional scripts and script tags on the Thank you and Order status pages (the last deadline was August 26, 2026). Purchase tracking was often rebuilt as a custom pixel at that point. Custom pixels load on the storefront, checkout, Thank you and Order status pages, so a custom pixel that sends
Purchasenext to the app’s ownPurchasedoubles every order. -
Check page views inside a custom pixel. Meta’s base code ends with
fbq('track', 'PageView');. Shopify’s custom pixel example sendsPageViewfrom ananalytics.subscribe("page_viewed", ...)subscription instead. If a custom pixel has both, every page view is sent twice. Keep only the subscription. -
Merge custom pixels that use the same pixel ID (for example one named for checkout and one for the storefront). Each one loads on every storefront and checkout page, so each sends its events everywhere unless its code says otherwise.
-
Check GTM for two tags that send the same event on overlapping triggers, and keep one.
-
Save every change, and publish GTM if you changed it.
Meta’s help says it can discard a repeated browser event when both copies carry the same event name and event ID. Do not rely on that: remove the extra copy.
Common causes
- Meta pixel code is still in
theme.liquidafter the Facebook & Instagram app was connected. - A custom pixel sends Meta events for the same pixel ID as the app.
Purchasetracking was rebuilt as a custom pixel during the Thank you page upgrade, while the app also tracks purchases.- Another app adds its own Meta pixel through an app embed or an app pixel.
- GTM runs twice, or two GTM tags send the same event.
How to verify the fix
- In a private window, accept cookies and check that each event appears once per pixel ID: on page load, on a product page and after adding to cart.
- In Meta Events Manager, use Test events to confirm that checkout events, including
Purchase, arrive once from the browser. - Re-run the check on IsPixelWorking. The issue should be gone.
Sources
- Shopify Help Center, Meta pixel (remove pixel code from
theme.liquid; more than one pixel can result in duplicate or incorrect data): https://help.shopify.com/en/manual/reports-and-analytics/facebook-pixel - Shopify Help Center, Facebook data sharing (data sharing levels; events the app tracks): https://help.shopify.com/en/manual/promoting-marketing/analyze-marketing/meta-data-sharing
- Shopify Help Center, Pixels overview (pixels load on the storefront, checkout, Thank you and Order status pages): https://help.shopify.com/en/manual/promoting-marketing/pixels/overview
- Shopify Help Center, Manage your custom pixels (connect, disconnect, delete): https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/manage
- Shopify Help Center, Create custom pixel code (Meta pixel example with
page_viewed): https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/code - Shopify Help Center, Migrating pixels (remove old pixel code before connecting a new pixel to avoid duplicate tracking): https://help.shopify.com/en/manual/promoting-marketing/pixels/pixel-migration
- Shopify Help Center, Upgrading and replacing your Thank you and Order status pages (August 26, 2026 deadline, automatic upgrade): https://help.shopify.com/en/manual/checkout-settings/customize-checkout-configurations/upgrade-thank-you-order-status
- Shopify.dev, Order status script tags (deadlines August 28, 2025 for Plus, August 26, 2026 for other stores): https://shopify.dev/docs/apps/build/online-store/script-tag-deprecation/order-status
- Shopify Help Center, Extend your theme with apps (app embeds): https://help.shopify.com/en/manual/online-store/themes/customizing-themes/apps
- Meta for Developers, Meta Ads Data Advisor (formerly Meta Pixel Helper; “Duplicate Pixel code”): https://developers.facebook.com/docs/meta-pixel/support/pixel-helper
- Meta Business Help Center, About deduplication for Meta Pixel and Conversions API events (redundant pixel events with the same event ID): https://www.facebook.com/business/help/823677331451951
- Meta Business Help Center, Test events tool: verify app and web browser events for Meta: https://www.facebook.com/business/help/2040882565969969