Meta Pixel firing twice on WordPress: why it happens and how to fix it

When the Meta Pixel (formerly Facebook Pixel) reports every event twice on a WordPress site, the usual reason is that the pixel is installed twice, or that two different things send the same event. The other common reason is that the event is tied to a page view, so a reload, the back button or a second tab sends it again. Find which one you have with the checks below, then remove the extra source.

Why the Meta Pixel fires twice

There are five causes that explain almost every case. A site can have more than one at the same time.

1. The pixel is installed twice

This is the most common cause. The same pixel ID is loaded by two different things, and each one sends its own PageView and its own events. Typical pairs on WordPress:

  • a snippet pasted into the theme header (or a “header and footer scripts” plugin) and a pixel plugin;
  • Google Tag Manager with a Meta Pixel tag, and a pixel plugin;
  • two pixel plugins, often an old one that was never removed;
  • an e-commerce or form plugin with its own “Facebook pixel” setting, and a pixel plugin.

2. Meta's automatic events duplicate your own

The pixel can detect some events by itself, for example button clicks and page information. Meta calls this automatic configuration (in Events Manager it appears as a setting to track events automatically without code). If you also send your own Lead or Purchase events, a click on the submit button can be reported once by the automatic detection and once by your code.

3. Multi-step forms on one URL

Many quote, application and booking forms keep every step on the same address. A setup that fires an event “when the page loads” cannot tell the difference between a real new arrival and a reload, the back button, the same page opened in a second tab, or a step loaded again in the background. One applicant can then report two, three or four InitiateCheckout events.

4. Thank-you pages that fire on every load

A Lead or Purchase event on a thank-you page fires each time that page is opened: when the visitor reloads it, comes back to it with the back button, opens it from browser history or a bookmark, or shares the link with a colleague. None of these is a new conversion.

5. A form success event and a page event both fire

Some setups listen for the form plugin's “submitted” event and fire the same event when the thank-you page loads. Both run for one submission. The same happens when a form plugin has its own pixel option switched on while another tool also tracks the form.

How to check what is firing

Use more than one of these checks. Each shows a different part of the picture.

  1. Meta Pixel Helper. Install Meta's Pixel Helper browser extension and open the page. It lists each pixel ID found and each event sent. Two entries for the same event, or a warning that the pixel was found more than once, points to cause 1.
  2. Events Manager → Test events. Open your dataset (pixel) in Meta Events Manager, choose Test events, enter your site address and use the site in the window that opens. Events appear within seconds, so you can reload, press back and submit the form, and watch what each action sends.
  3. The browser's network tab. Open the developer tools (F12 in most browsers), go to the Network tab and filter for facebook.com/tr. Each request is one event; the ev= parameter is the event name and id= is the pixel ID. Two requests with the same ev= for one action means two senders. Clicking a request shows which script started it, which usually tells you which plugin or snippet is responsible.
  4. Search the page source. View the page source and search for fbq('init' and for your pixel ID. More than one init for the same ID is a strong sign of a double install.

A typical request for a doubled Lead looks like this, twice:

https://www.facebook.com/tr/?id=123456789012345&ev=Lead&dl=https%3A%2F%2Fexample.com%2Fthank-you%2F&...

How to fix it

  1. Keep one pixel source. Choose one tool that loads the pixel and sends events, and remove the pixel from everything else: theme header, tag manager, old plugins and the pixel options of form or shop plugins. Clear your page cache afterwards, because cached pages can keep the old code.
  2. Turn off automatic configuration if you define events yourself. If you send your own events, switch off automatic event tracking in Events Manager, or have your pixel tool switch it off in code. Otherwise a click can be counted by both.
  3. Fire a conversion on the success, not on the page view. A lead is a submission the server accepted. Fire the event when the form plugin reports success, rather than every time a page or step is shown. See how to track form submissions once.
  4. Limit how often each event can fire. Decide, for each event, what counts as “again”. A Lead on a thank-you page should normally fire once per visitor or once per session, so a reload or a bookmark does not count a second time.
  5. Deduplicate the browser and server copies. If you also send events with the Conversions API, give each browser event and its server copy the same event ID, or Meta counts both. This is explained in Conversions API duplicate events.

After each change, repeat the checks above: reload, press back, open a second tab and submit the form once. Each action should send what you expect and nothing more.

How Pixelonce handles this

Pixelonce is a free WordPress plugin built around this problem. It does not stop you making a double install, but it removes the other causes and makes the rest easy to see.

  • It owns the pixel. Pixelonce loads the pixel itself and switches automatic configuration off, so only the events you declare are sent. Remove other copies of the same pixel when you install it.
  • Every event says how often it may fire. Each event has a “how often” setting: every time, once per page view, once per visit, once per session, once per visitor, or once per product or plan ID. A Lead set to once per visitor is not counted again when the thank-you page is reloaded or bookmarked. See how often (scopes) in the docs.
  • Multi-step forms on one URL. Each step is described as its own page (for example /apply?step=2), so moving to the next step counts, and a reload or the back button does not.
  • Form success, not page load. Background-submit bindings fire an event only when the form's admin-ajax or fetch request reports success. See bindings.
  • A debug overlay that explains itself. Add ?stepcount_debug=1 to a page address while logged in as an administrator. The overlay lists every event on the page, whether it fired, and why not when it did not. See debugging.
The Pixelonce debug overlay on step 1 of a car finance form: consent info, InitiateCheckout skipped because it already fired this session, Schedule fired with step, market de and lead_type car_finance, PageView fired, and ViewContent fired with content_ids hy-440, value 24990 and currency EUR.
Debug overlay: every event on the page, fired or skipped, and why.

The plugin was first developed as StepCount, so the debug parameter keeps that name.