在 JSON-LD 中创建一系列产品

And*_*len 4 seo structured-data json-ld

有人可以发现我下面的代码有什么问题吗?(它不会在 Google 结构化测试工具中验证。)我正在尝试创建 JSON-LD 代码以添加到有多个待售产品的页面。

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@graph": [
{
  "@type": “Product”,
  "name": “tshirt",
  “description”: "test copy 1.”,
  “image”: “image.jpg”
},
{
  "@type": “Product”,
  "name": “tshirt 2",
  “description”: "test copy 2.”,
  “image”: “image2.jpg”
}
]
}
</script>
Run Code Online (Sandbox Code Playgroud)

任何帮助深表感谢!

uno*_*nor 5

您正在使用而不是"在某些地方。

替换这些,您的代码段验证:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@graph": [
{
  "@type": "Product",
  "name": "tshirt",
  "description": "test copy 1.",
  "image": "image.jpg"
},
{
  "@type": "Product",
  "name": "tshirt 2",
  "description": "test copy 2.",
  "image": "image2.jpg"
}
]
}
</script>
Run Code Online (Sandbox Code Playgroud)

更新:此代码段不再使用Google Rich Results Test 进行验证。Schema 正在积极开发中,因此有时需求会在一段时间后发生变化。对于产品列表,Google 建议使用所谓的carousel