1

I have a single page website and I am trying to invoke multiple events for the same Facebook Custom pixel from here.
I am using Facebook Pixel Helper on Chrome to test.

Here is the scenario:

This is how my javascript file looks:

 (function() {
var _fbq = window._fbq || (window._fbq = []);
if (!_fbq.loaded) {
var fbds = document.createElement('script');
fbds.async = true;
fbds.src = '//connect.facebook.net/en_US/fbds.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(fbds, s);
_fbq.loaded = true;
}
_fbq.push(['addPixelId', '1634281670122256']);
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', 'PixelInitialized', {}]);

function trackFbEventDownloadBrochure() {
    window._fbq.push(['track', 'ViewContent', {content_name: 'brochure-pdf'}]);
}

function trackFbEventDownloadTsaWay() {
    window._fbq.push(['track', 'ViewContent', {content_name: 'tsa-way-pdf'}]);
}

It is included in my html just before the closing tag:

<script type="text/javascript" src="js/fb-custom-tracking.js"></script>
</head>

I can see that the pixel is initialized correctly through the Fb Pixel helper tool.

Now I am sending a 'PageView' event with content_name="download-brochure" when the user clicks a link "Download Brochure". This I am doing using "onclick=trackFbEventDownloadBrochure();" on the link.

This pixel also loads successfully, although with a warning that the pixel took too long to load. I am assuming its because the user took some time before she clicked the link and I can safely ignore this.

Next, I have another link "Download TSA Way PDF". On this link, I have "onclick=trackFbEventDownloadTsaWay();". However, when the user clicks on this link (after having clicked on the other link), I see an error on the Fb Pixel Helper tool.

Custom Audience Pixel activated 2 times.    
Event ID: ViewContent    
Custom Audience Pixel pixel activated multiple times on this web page, which can cause errors in your event tracking.Learn more    
View Event Log     
Pixel ID: 1634281670122256    
URL Called: Show    
Pixel Location: Show    
Load Time: 82.86 ms    
Time To Request: 5501.48 ms    
content_name: brochure-pdf

Same thing happens if I click the "Download TSA Way PDF" link first and then "Download Brochure".

It appears that we cannot send the same event twice from the same page, even if its sent with different parameters.

Can somebody help me with this ?

Thanks in advance !

Piyush

  • You can try using App Events if you need to log multiple events on the same page: https://developers.facebook.com/docs/reference/javascript/FB.AppEvents.LogEvent – subeeshb Dec 29 '15 at 03:26

0 Answers0