'Facebook Pixel Conversion Tracking GTM - Error: "Facebook Pixel pixel activated multiple times"

I have problems setting up conversion tracking for a lead with the new Facebook pixel and GTM.

This is what I did:

  1. Facebook Base Code integrated with GTM on every page (see code below)
  2. Custom Code for the Conversion Tracking (Lead) integrated with GTM when a particular form submit happens (see code below)

When a conversion happens the following error shows up on the Facebook Pixel Helper : “Facebook Pixel activated 2 times…Facebook Pixel pixel activated multiple times on this web page, which can cause errors in your event tracking”

enter image description here

FACEBOOK Base Code:

<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue[];t=b.createElement(e);  t.async=!0;            
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '11111...');
fbq('track', "PageView");</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=11111...&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->`

CONVERSION TRACKING Code for the Lead:

<script>fbq('track', 'Lead');</script>
<noscript>
    <img height="1" width="1" style="display:none"    src="https://www.facebook.com/tr?id=11111...&ev=Lead&noscript=1"/>
</noscript>

No idea where the problem is actually. Can you help?

I also tried to remove the:

<noscript>
    <img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=11111...&ev=Lead&noscript=1"/>
</noscript>`

but in this case the conversion wouldn’t be triggered at all.



Solution 1:[1]

Keep two Custom HTML in total:

The first Custom HTML tag should contain the Facebook pixel base code as per your first example. Set it to fire on every page and change the setting to fire "Once per page".

The second Custom HTML tag should contain your Lead event as per below:

<script>
fbq('track', 'Lead');
</script>

Set this to fire "Once per Event" if you are firing it on an event such as a lead form submission, or "Once per Page" if you fire this tag on a page load such as a thank-you-page.

The trick is the to ensure that you change the sequencing setting for the second tag. On the lead event tag, set up the Facebook Base Tag to fire before the lead event tag does - this is likely currently the problem.

The lead event does not work if the facebook base pixel is not already loaded - currently they may be firing in the wrong order.

GTM example

Your 'noscript' snippets should be left out as they will not be fired anyways inside a Custom HTML tag. The 'noscript' snippets are actually there to help if javascript is broken or disabled in the browser, so if you want them to work within GTM you need to create a Custom Image tag inside GTM instead and add the noscript image URL there such as below:

GTM image tag example

Make sure that you don't have both options enabled at the same time as it will cause double-counting of conversions in the Facebook reporting. Instead set up a GTM criteria that checks whether javascript is enabled or not and fire the image tag only when it is not and you are golden.

These tricks should be credited to the amazing Jehoshua Choen of Analytics Ninja, so please read up on his whole post on the topic if you want further clarification.

Solution 2:[2]

I don't have any experience with this case. But i am also installed FB Pixel via GTM. But i did not have any chance to install further conversion tracking down to lower step in sale funnel.

However, as i understand, In this case there is diffent between installing directly in website code and via GTM because:

Installing directly: Facebook will regconize the user's action as one event with one parametter about conversion action type.

Installing via GTM: Facebook will regconize the user's action as two separate d events. Because GTM send two tags separately in two events. Therefore, the option of tag sequencing is there to command GTM send 2 tags as one event.

Remember that: Event that is the concept that both GG and FB tracking system accept. And Conversion Tag in GTM is a technicaly concept used to transfer in fo to Google without involving with source code. So, do not misunderstand that a tag is a event. GTM affer interpreting the tag settings or code (if custom JS or HTML Tag) will packed with the original to send to browser. And Pixel Helper read & analyze the site from browser. That 's why wrong setting could cause GTM send 2 tags as 2 events snippet code to browser and then Pixel Helper read them as 2 individual events in 2 individual duplicated pixels.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Henrik Söderlund
Solution 2 VU Linh