How would I put multiple Facebook tracking pixels on one web page?

后端 未结 7 1102
情书的邮戳
情书的邮戳 2020-12-30 11:36

We are trying to use Facebook\'s Ad tracking pixels to track ads. we looked at Facebook\'s documentation and that led me no where.

I need to know how to trigger mult

相关标签:
7条回答
  • 2020-12-30 12:17

    This is the current working approach that I recommend based on Facebook source code (based on https://developers.facebook.com/). Use the "init" function multiple times, that simple...

    <!-- 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','https://connect.facebook.net/en_US/fbevents.js');
    fbq('init', '158xxxxxxxxxx911');
    fbq('init', '180xxxxxxxxxx762');
    fbq('init', '125xxxxxxxxxx694');
    fbq('track', 'PageView');
    </script>
    <noscript><img height="1" width="1" style="display:none"
    src="https://www.facebook.com/tr?id=180xxxxxxxxxx762&ev=PageView&noscript=1"
    /></noscript>
    <!-- End Facebook Pixel Code -->
    
    0 讨论(0)
提交回复
热议问题