我可以同时使用Offer和AggregateOffer吗?

时间:2019-04-07 16:46:23

标签: schema.org google-rich-snippets

我有一个产品页面,可以从其他卖家处购买产品。

我看到Google seperatesAggregateOfferOffer之间,好像我应该选择一个标签还是另一个标签。

我尝试像这样使用两者,并且在使用Google工具进行测试时返回了标记错误,因为我两次使用offers

{
  "@context": "https://schema.org/",
  "@type": "Product",
  "name": "MyName",
  "image": [
    "https://www.example.com/image1.jpg",
    "https://www.example.com/image2.jpg"
   ],
  "offers": {
    "@type": "AggregateOffer",
    "lowPrice": "100",
    "highPrice": "150",
    "priceCurrency": "USD",
    "offerCount": "3"
  }

      "offers": {
    "@type": "Offer",
    "url": "https://www.example.com/page/",
    "priceCurrency": "USD",
    "price": "100",
    "itemCondition": "https://schema.org/NewCondition",
    "availability": "https://schema.org/InStock",
    "itemOffered": "Thing"
  }

}

我想提供尽可能多的信息,据Google称,诸如availability之类的信息适用于Offer而非AggregateOffer

所以我有两个选择:

只使用上述Offer标记之一,或者使用AggregateOffer并在其中添加availability之类的字段,即使我在任何地方都没有看到此示例。

做什么会更好?

1 个答案:

答案 0 :(得分:0)

Gradle: Building a modularized library that is compatible with Java 8可以引用其所有AggregateOffer项:

{
  "@context": "https://schema.org/",
  "@type": "Product",

  "offers": {
    "@type": "AggregateOffer",
    "offerCount": 3,

    "offers": [
      {
        "@type": "Offer"
      },
      {
        "@type": "Offer"
      },
      {
        "@type": "Offer"
      }
    ]

  }

}

根据Offer,Google丰富的产品搜索结果没有利用Offer所组成的单个AggregateOffer项目。

还要注意,AggregateOffer可以具有Offer可以拥有的所有属性(例如availability),因为Offer是父类型,但是这些属性随后适用于汇总商品本身,而不是汇总商品本身,因此在这种情况下,大多数属性都不有意义。

相关问题