首页 > 解决方案 > Facebook 像素没有读取 ajax 加载页面中的微数据?

问题描述

我试图让 Facebook 像素 - 读取 ajax 加载页面中的微数据。

我的索引页面中有像素初始化代码,它跟踪"PageView"事件,我可以在 facebook.com/events_manager 中看到该事件。

<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', 'xxxxx');
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=xxxxx&ev=PageView&noscript=1"
/></noscript>

然后我在 ajaxloaded .asp 页面中有微数据,当我查看 Chrome 开发工具中的页面代码时,我发现它写入了正确的标签和值。

response.write "<meta property=""og:id"" content=""123"" />"
response.write "<meta property=""og:title"" content=""Test product"" />"
response.write "<meta property=""og:description"" content=""Some text"" />"
response.write "<meta property=""og:url"" content=""https://atervinnmera.se/shop2/"" />"
response.write"<meta property=""og:link"" content=""https://atervinnmera.se/shop2/"" />"
response.write "<meta property=""og:image"" content=""https://someimage.jpg"" />"
response.write "<meta property=""og:image_link"" content=""https://someimage.jpg"" />"
response.write "<meta property=""product:availability"" content=""in stock"" />"
response.write "<meta property=""product:price:amount"" content=""100"" />"
shopCurrency = "<meta property=""product:price:currency"" content=""SEK"" />"
shopProduktId = "<meta property=""product:retailer_item_id"" content=""4433"" />"
shopProdukterId = "<meta property=""product:item_group_id"" content=""23"" />"

那么为什么它不读取元标签并在 Facebook 中显示值呢?我不知道我错过了什么?任何输入都非常感谢,谢谢。

标签: facebook-pixel

解决方案


推荐阅读