javascript - Multiple Facebook Custom Audience Tracking Events on the same page -


i have single page website , trying invoke multiple events same facebook custom pixel here.
using facebook pixel helper on chrome test.

here scenario:

this how 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 included in html before closing tag:

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

i can see pixel initialized correctly through fb pixel helper tool.

now sending 'pageview' event content_name="download-brochure" when user clicks link "download brochure". doing using "onclick=trackfbeventdownloadbrochure();" on link.

this pixel loads successfully, although warning pixel took long load. assuming because user took time before clicked link , can safely ignore this.

next, have link "download tsa way pdf". on link, have "onclick=trackfbeventdownloadtsaway();". however, when user clicks on link (after having clicked on other link), see error on fb pixel helper tool.

custom audience pixel activated 2 times.     event id: viewcontent     custom audience pixel pixel activated multiple times on web page, can cause errors in event tracking.learn more     view event log      pixel id: 1634281670122256     url called: show     pixel location: show     load time: 82.86 ms     time request: 5501.48 ms     content_name: brochure-pdf 

same thing happens if click "download tsa way pdf" link first , "download brochure".

it appears cannot send same event twice same page, if sent different parameters.

can me ?

thanks in advance !

piyush


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -