简体   繁体   English

自 Google 更新以来的结构化数据(报价)无效:应提供报价或评论或聚合评级之一

[英]Invalid structured data (offer) since Google Update : one of offers or review or aggregateRating should be provided

I have the following piece of structured data:我有以下结构化数据:

{
  "@context": "https://schema.org/",
  "@type": "Offer",
  "priceCurrency": "EUR",
  "price": "12890",
  "availability": "https://schema.org/InStock",
  "priceValidUntil": "2019-12-13",
  "itemOffered": {
    "@type": "Car",
    "brand": {
      "@type": "Brand",
      "name": "Renault"
    },
    "manufacturer": {
      "@type": "Corporation",
      "sameAs": "https://www.wikidata.org/wiki/Q6686",
      "name": "Renault"
    },
    "name": "Renault Captur Life",
    "model": "Captur Life",
    "image": "https://www.xxxx.fr/uploads/models/renault-captur.png",
    "description": "Renault Captur Life neuve - Essence - 90cv - 5 portes : 12 890€ ",
    "fuelType": "Essence",
    "vehicleTransmission": "Manuelle",
    "vehicleConfiguration": "0.9 tce 90 bvm5",
    "numberOfDoors": "5",
    "vehicleEngine": {
      "@type": "EngineSpecification",
      "enginePower": {
        "@type": "QuantitativeValue",
        "value": "90",
        "unitCode": "N12"
      }
    },
    "itemCondition": "https://schema.org/NewCondition"
  }
}

According to Google Structured Data Testing Tool , there is a problem (this is a recent update, my structured data used to be valid):根据谷歌结构化数据测试工具,有一个问题(这是最近的更新,我的结构化数据曾经是有效的):

One of offers or review or aggregateRating should be provided.应提供 offer 或 review 或 aggregateRating 之一。

According to the Rich Snippets Testing Tool , it's valid.根据Rich Snippets Testing Tool ,它是有效的。

So what's going on here?那么这里发生了什么? Why should I have to add offers or review or aggregateRating ?为什么我必须添加offersreviewaggregateRating

The change caused that error to go out when people have structured their data in your way.当人们以您的方式构建数据时,该更改导致 go 错误。 ie the offer as the main entity.即作为主要实体的要约。 If you flip your markup around so it is a product with an offer the error should go away.如果你翻转你的标记,它是一个有报价的产品,错误应该 go 消失。 Both ways are valid, the the second one is in line with Googles examples and what their testing tools report on.两种方法都有效,第二种方法与 Google 的示例及其测试工具报告的内容一致。

To expand on Tony's answer, Offer should be an extension of Car ( Product ).为了扩展 Tony 的答案, Offer应该是Car ( Product ) 的扩展。 Product can be nested within Offer ( see this recent question ) but that doesn't look like what you want here. Product可以嵌套在Offer中( 请参阅这个最近的问题),但这看起来不像您想要的。

Modifying your JSON-LD to this will make things valid (as far as Googles Structured Data Testing Tool is concerned):将您的 JSON-LD 修改为此将使事情有效(就Google 结构化数据测试工具而言):

{
  "@context": "https://schema.org/",
  "@type": "Car",
  "fuelType": "Essence",
  "model": "Captur Life",
  "name": "Renault Captur Life",
  "description": "Renault Captur Life neuve - Essence - 90cv - 5 portes : 12 890€ ",
  "vehicleEngine": {
      "@type": "EngineSpecification",
      "enginePower": {
          "@type": "QuantitativeValue",
          "value": "90",
          "unitCode": "N12"
      }
   },
   "manufacturer": {
       "@type": "Corporation",
       "sameAs": "https://www.wikidata.org/wiki/Q6686",
       "name": "Renault"
   },
   "image": "https://www.xxxx.fr/uploads/models/renault-captur.png",
   "vehicleTransmission": "Manuelle",
   "vehicleConfiguration": "0.9 tce 90 bvm5",
   "numberOfDoors": "5",
   "brand": {
       "@type": "Brand",
       "name": "Renault"
   },
   "offers": [{
       "@type": "Offer",
       "price": "12890",
       "priceCurrency": "EUR",
       "availability": "https://schema.org/InStock",
       "priceValidUntil": "2019-12-13"
    }],
    "itemCondition": "https://schema.org/NewCondition"
  }
}

In this scenario, we nest the Offer in Car so that Car describes everything about the vehicle and the nested Offer describes how it can be purchased.在这种情况下,我们将Offer嵌套在Car中,以便Car描述有关车辆的所有内容,嵌套的Offer描述如何购买它。

I'd note that as of this writing the Rich Snippets Testing Tool is still in beta so I'd take its results with a grain of salt.我注意到,在撰写本文时, Rich Snippets Testing Tool仍处于测试阶段,因此我会对它的结果持保留态度。 You could argue since it is a new tool, it might be more in tune with what Google does with Rich Snippets.. but in your case here I believe the expectations from the Structured Data Testing Tool make sense.您可能会争辩说,因为它是一个新工具,它可能更符合 Google 对 Rich Snippets 所做的工作。但在您的情况下,我相信结构化数据测试工具的期望是有道理的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 网站未在搜索列表中显示评论结构化数据 - Site does not show review structured data in search listings Google结构化数据错误:“为http://www.example.com/提供的所有值必须具有相同的域名。” - Google structured data error: “All values provided for http://www.example.com/ must have the same domain.” 我的结构化数据类型应该是Product还是ItemPage? - Should my structured data type be Product or ItemPage? 使用 Google Places 提供的 API 密钥无效 - The provided API key is invalid using Google Places 结构化数据徽标在Google搜索中不可见 - Structured data logo is not visible in Google Search Google自定义搜索,结构化数据不起作用 - Google Custom Search, structured data not working 正确部署Google Rich Card的结构化数据 - Correct deployment of structured data for Google rich cards 如何使用Google的结构化数据内容显示电影时间表? - How to use Google's structured data content to display movie schedule? 是否可以在标准Google搜索中按微数据/结构化数据进行搜索? - Is it possible to search by microdata/structured data in a standard Google search? JobPosting结构化数据 - JobPosting Structured Data
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM