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.

  1. Open your store in a private (incognito) window, open developer tools (F12), go to Network and filter by facebook.com/tr.
  2. Accept cookies.
  3. In each request’s payload, id is the pixel ID and ev is the event name. Two requests with the same id and the same ev at almost the same moment are a duplicate. Different id values mean two different pixels, which is a separate question.
  4. To see where each copy comes from, compare the dl field (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.
  5. Repeat on a product page (ViewContent) and after adding a product to the cart (AddToCart). The Facebook & Instagram app tracks PageView, ViewContent, Search, AddToCart, InitiateCheckout, AddPaymentInfo and Purchase, 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.

  1. 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 fbq or your pixel ID in its code).
    • Theme code: go to Online Store, open the menu of your current theme, click Edit code, open theme.liquid and search for fbevents.js and fbq(. 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 (in theme.liquid and as a custom pixel); then every tag fires twice.
  2. 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.liquid and 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.

  3. 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 Purchase next to the app’s own Purchase doubles every order.

  4. Check page views inside a custom pixel. Meta’s base code ends with fbq('track', 'PageView');. Shopify’s custom pixel example sends PageView from an analytics.subscribe("page_viewed", ...) subscription instead. If a custom pixel has both, every page view is sent twice. Keep only the subscription.

  5. 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.

  6. Check GTM for two tags that send the same event on overlapping triggers, and keep one.

  7. 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.liquid after the Facebook & Instagram app was connected.
  • A custom pixel sends Meta events for the same pixel ID as the app.
  • Purchase tracking 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

  1. 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.
  2. In Meta Events Manager, use Test events to confirm that checkout events, including Purchase, arrive once from the browser.
  3. Re-run the check on IsPixelWorking. The issue should be gone.

Sources