我正在尝试在电子商务产品页面上执行此操作。我在产品页面的所有综合浏览量上触发了以下自定义 HTML 标记。它使用数据层变量,调试/预览工具显示每个变量的正确值:
{
“@context” : “http://schema.org”,
“@type”: “Product”,
“name”: {{productName}},
“image”: {{productImage}},
“description”: {{productDescription}},
“brand”: {
“@type”: “Thing”,
“name”: {{productBrand}}
},
“offers”: {
“@type”: “Offer”,
“priceCurrency”: “GBP”,
“price”: {{productPrice}}
}
}
我想我正确地遵循了模板,但这就是谷歌结构化数据测试工具中显示的内容:
“@context” : “http://schema.org”,
“@type”: “Product”,
“name”: google_tag_manager[“GTM-PHZTTZ”].macro(‘gtm1469648023100’),
“image”: google_tag_manager[“GTM-PHZTTZ”].macro(‘gtm1469648023101’),
“description”: google_tag_manager[“GTM-PHZTTZ”].macro(‘gtm1469648023102’),
“brand”: {
“@type”: “Thing”,
“name”: google_tag_manager[“GTM-PHZTTZ”].macro(‘gtm1469648023103’)},
“offers”: {
“@type”: “Offer”,
“priceCurrency”: “GBP”,
“price”: google_tag_manager[“GTM-PHZTTZ”].macro(‘gtm1469648023104’)
}
它似乎从 GTM 的数据模型返回宏的名称而不是值?我做错什么了吗?