晚三秒再加载Facebook Conversion Pixel

晚三秒再加载Pixel,可以有效的剔除出去那些误点击广告的人,使得你积累的种子用户更加精准。

 

Here’s the default FB pixel they give you from the Pixel Panel:

[code lang=”js”]
<!– 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’, ‘XXXXXXXXXXXXXXXX’);
fbq(‘track’, ‘PageView’);
fbq(‘track’, ‘AddtoCart’);
</script>
<noscript><img height=”1″ width=”1″ style=”display:none” src=”https://www.facebook.com/tr?id=XXXXXXXXXXXXXXXX&ev=PageView&noscript=1″ /></noscript>
<!– End Facebook Pixel Code –>
[/code]

We are concerned about the AddtoCart tracking property, we want to fire this only for people who read the page/stay on it for minimum 3 seconds. So we wrap it in some sexy code that will delay it from firing.

Here’s the FB pixel from above with the setTimeout function added

[code lang=”js”]
<!– 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’, ‘XXXXXXXXXXXXXXXX’);
fbq(‘track’, ‘PageView’);

setTimeout(function(){
fbq(‘track’, ‘AddtoCart’);
}, 3000);

</script>
<noscript><img height=”1″ width=”1″ style=”display:none” src=”https://www.facebook.com/tr?id=XXXXXXXXXXXXXXXX&ev=PageView&noscript=1″ /></noscript>
<!– End Facebook Pixel Code –>[/code]

 

Note: Be sure to replace XXXXXXXXXXXXXXXX with your pixelID!

TLDR version:

[code]

We’ve added setTimeout(function(){ }, 3000;
around the “function” we want to delay ->
fbq(‘track’, ‘AddtoCart’);

[/code]

PS: You can use 3rd party tools like Google Tag Manager, or PixelYourSite to delay firing the pixel through those, you may also create a custom audience, and optimize for the top 25% of people that spent time on your site, or top 10% or top 1%. So there’s multiple ways.

原文链接如下:
iamattila.com/media-buying-101/how-to-delay-firing-your-facebook-conversion-pixel.php

版权声明:本文内容以盗版加工为主,原创为辅,意在分享,收藏,记录工作中的点点滴滴。不代表任何组织,不代表任何商业机构,也不代表我个人所有想法。
心晴客栈 » 晚三秒再加载Facebook Conversion Pixel

发表回复