All posts

Why Your Facebook Pixel Might Be Firing Twice on Shopify

Here's a symptom worth paying attention to: your Meta Ads Manager shows more purchases, or a lower cost per purchase, than what actually shows up in your Shopify orders. Before you assume the ads are working better than they look, rule out a boring, common cause first: the pixel firing twice on every page.

What "firing twice" actually means

Meta's pixel loads with a snippet that calls a function named fbq. The first thing that snippet does is fbq('init', 'YOUR_PIXEL_ID'). That call is supposed to happen exactly once per page load. Every event after that, a page view, an add to cart, a purchase, gets counted once per init call that's active.

If init gets called twice on the same page, whether with the same ID or two different ones, every single event after it doubles too. Two page views for one visit. Two purchases logged for one order. Nothing in your store changed. The count did.

How this happens on a Shopify store specifically

It's rarely one obvious mistake. It's usually two systems that both think they own the pixel:

  • The theme has it built in, often through Shopify's own "Facebook & Instagram" sales channel, which installs the pixel for you when you connect it.
  • A marketing or upsell app pastes in its own copy of the same base pixel snippet, because the app wants to fire its own events and the easiest way to guarantee that is to include the whole thing again.
  • Someone adds it a second time by hand, through Additional Scripts or a Custom Pixel, not realizing the sales channel already covers it.

Each piece looks correct on its own. It's only the combination that's broken, which is exactly why it tends to sit there for months without anyone noticing.

How to check your own site in about two minutes

  1. Open any page on your store.
  2. Right-click and choose View Page Source (Ctrl+U on Windows, Cmd+Option+U on Mac).
  3. Press Ctrl+F (or Cmd+F) and search for fbq(.
  4. Count how many times you see fbq('init',.

One is normal. Two or more, even if it's the same ID both times, means the base pixel is loading twice, and every event on that page is doubling with it.

You can also search for connect.facebook.net and count how many <script> tags load fbevents.js. More than one script tag pulling that file in is the same problem from a different angle.

What it actually costs you

This isn't just a vanity metric issue. Meta's ad delivery algorithm optimizes toward whichever audience and creative your pixel tells it is converting. Feed it double the purchases, and it optimizes harder toward whatever it thinks is working, which might just be noise. Your reported cost per purchase looks artificially good, which is the kind of number that convinces someone to raise the budget on a campaign that isn't actually performing the way the dashboard claims.

The fix

Figure out which of the two sources is the extra one. If Shopify's own Facebook & Instagram sales channel is already connected and configured, that's usually the one to keep, since it's maintained by Shopify and stays current with Meta's requirements. Any app or Additional Scripts snippet duplicating that base pixel is the one to remove.

After removing it, repeat the two-minute check above. You should see exactly one fbq('init', ...) call left on the page.

Our free scan checks for exactly this, a Meta Pixel base snippet calling init more than once, along with a handful of other duplicate-tag problems. Run your store through it at setello.com/scan and you'll get a plain answer on whether this is happening on your site.