晚三秒再加载Facebook Conversion Pixel

广告投放 心晴客栈 1596次浏览 0个评论 扫描二维码

晚三秒再加载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

支持博主

心晴客栈 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明晚三秒再加载Facebook Conversion Pixel
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址