如何使用JSON-LD代码为多产品页面启用丰富网页摘要?

时间:2015-10-14 10:49:49

标签: schema.org rich-snippets json-ld

我想在google SERPS中显示产品页面的丰富网页摘要。这是一个页面:

  • 包含多个产品,每个产品都有单独的价格
  • 具有平均总评分

据我了解,可以使用多个商品在架构组织中向一个页面添加多个产品。问题是我无法找到有关如何使用JSON-LD执行此操作的文档。我自己在下面的代码中尝试过,但不知道这是否正确。我可以添加这样的优惠,还是需要以不同的方式添加?

<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Product",
"aggregateRating": {
    "@type": "AggregateRating", 
    "ratingValue": "[rating variable]",
    "reviewCount": "[count variable]"
},
"name": "[product name]",
"offers": {
    "@type": "Offer", 
    "price": "[price of product]",
    "priceCurrency": "[currency]"
},
"name": "[product name]",
"offers": {
    "@type": "Offer", 
    "price": "[price of product]",
    "priceCurrency": "[currency]"
},
"name": "[product name]",
"offers": {
    "@type": "Offer", 
    "price": "[price of product]",
    "priceCurrency": "[currency]"
},
}
</script>

1 个答案:

答案 0 :(得分:2)

只需创建一系列优惠。

<script type="application/ld+json">
{
  "@context": "http://schema.org/",
  "@type": "Product",
  "name": "[name]",
  "image": "[logo]",
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "[rating],
    "reviewCount": "[votes]"
  },
  "offers": [{
    "@type": "Offer",
    "priceCurrency": "[currency]",
    "price": "[price]",
    "category": {
      "@type": "thing",
      "name": "[name product]"
    }
  },{
    "@type": "Offer",
    "priceCurrency": "[currency]",
    "price": "[price]",
    "category": {
      "@type": "thing",
      "name": "[name product]"
    }
  },{
    "@type": "Offer",
    "priceCurrency": "[currency]",
    "price": "[price]",
    "Category": {
      "@type": "thing",
      "name": "[name product]"
    }
  }]
}
</script>