[英]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
?为什么我必须添加
offers
或review
或aggregateRating
?
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.