facebook-pixel - 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 中显示值呢?我不知道我错过了什么?任何输入都非常感谢,谢谢。
解决方案
推荐阅读
- testing - 由于源字符串,无法在机器人测试中比较字符串
- html - 用表格行 CSS 分页
- php - php循环全部导致下一个mysql查询
- facebook - Spark AR signal value
- angular-ng-if - Trying to provide hyperlink in HTML based on ng-if condition...not working
- css - 无法将 3rd 方 CSS 框架安装到 Vue 应用程序中
- oracle - 在 Oracle 数据库中创建测试表的用户
- javascript - ReactJS can't import 'react-router-dom' anymore
- angular - 展开物料表中的所有行
- javascript - Slow down the text fading on scroll down in squarespace gallery page