Restrict Facebook Pixel Event to a Single Pixel on a Multiple Pixel Website

Facebook Ads May 28, 2021

You may have noticed that on a site with multiple Facebook Pixels, an event fired will be available at all the Facebook Pixels initiated on that page. And this occasionally triggers duplicate conversions and entire ad reporting go wrong.

To solve this unexpected behavior Facebook introduced   trackSingle and trackSingleCustom on November 2017, but this is still mystery for among many marketers while this should be a best practice when tags are managed by multiple agencies.

Now, straight to the small snippet change that does the job -   trackSingle is used for standard events and trackSingleCustom  for custom events.

Below is the format for script, after trackSingle you need to specify which pixel ID will receive the event,


 fbq('trackSingle', '<PIXEL_ID>', 'Purchase', {
        value: 100,
        currency: 'USD',
  });

And for custom event need to use trackSingleCustom instead of trackCustom


fbq('trackSingleCustom', '<PIXEL_ID>', 'NewsletterSubmit');

Tags