如何在产品的报价中正确标记产品?
How do I correctly markup a Product within an Offer within a Product?
我在我维护的网站的产品页面上收到 Google 搜索控制台错误,我不确定如何解决这些错误。我得到的错误是:
One of offers or review or aggregateRating should be provided.
这很简单,可以正常修复,但是我的困惑是我已经在 json ld 的不同部分提供了 offers
数据。我的产品 json ld 的结构是
Product{
Offers{
Product {}
Product {}
}
}
其中嵌套产品是同一产品的不同变体。我在该网站上没有可用的评论或评分,因此我只能 offers
来解决错误。但是 google 搜索控制台说每个嵌套产品都应该有 offers
数据,尽管它们已经包含在报价结构中。
这似乎会陷入无限循环:我向产品变体添加报价,产品类型为 itemOffered,然后需要另一个报价,等等。
我如何组织我的结构化数据以支持我的产品 -> 变体层次结构,同时还取悦 google 搜索控制台并删除我看到的错误?
这是完整的 JSON ld,您可以直接 copy/paste 进入 Structured Data Testing Tool 以查看我正在描述的确切问题。
{
"@context":"http://schema.org/",
"@type":"Product",
"name":"Stripe Knit Sweater",
"url":"http://foobar.gov/product",
"image":[
"http://foobar.gov/product/image1"
],
"description":"this is a description",
"brand":{
"@type":"Thing",
"name":"My Store"
},
"offers":[
{
"@type":"Offer",
"availability":"http://schema.org/InStock",
"price":"64.0",
"priceCurrency":"USD",
"url":"http://foobar.gov/product/url",
"itemOffered":{
"@type":"Product",
/*ERROR IS HERE! : One of offers or review or aggregateRating should be provided.*/
"image":"http://foobar.gov/product/url",
"name":"Small / Blue/Black/Cream Stripe",
"weight":{
"@type":"QuantitativeValue",
"unitCode":"lb",
"value":"0.0 lb"
},
"url":"http://foobar.gov/product/url"
}
},
{
"@type":"Offer",
"availability":"http://schema.org/InStock",
"price":"64.0",
"priceCurrency":"USD",
"url":"http://foobar.gov/product/url",
"itemOffered":{
"@type":"Product",
/*ERROR IS HERE! : One of offers or review or aggregateRating should be provided.*/
"image":"http://foobar.gov/product/url",
"name":"Medium / Blue/Black/Cream Stripe",
"weight":{
"@type":"QuantitativeValue",
"unitCode":"lb",
"value":"0.0 lb"
},
"url":"http://foobar.gov/product/url"
}
}
]
}
根据您的示例,似乎每个 Offer
都是 Product
的变体。如果是这样的话,我不确定是否需要在变体中嵌套 Product
。据我从您的示例中可以看出,嵌套 Product
中唯一的 属性 是 weight
,您可以使用 additionalProperty
将其应用于 Offer
.
如果以这种方式发送到工具,一切都会生效:
{
"@context": "http://schema.org/",
"@type": "Product",
"name":"Stripe Knit Sweater",
"url":"http://foobar.gov/product",
"image":[
"http://foobar.gov/product/image1"
],
"description":"this is a description",
"brand":{
"@type":"Thing",
"name":"My Store"
},
"offers": [
{
"@type": "Offer",
"availability":"http://schema.org/InStock",
"price":"64.0",
"image":"http://foobar.gov/product/url",
"name":"Small / Blue/Black/Cream Stripe",
"priceCurrency":"USD",
"url":"http://foobar.gov/product/url",
"additionalProperty": {
"@type": "PropertyValue",
"name": "Weight",
"unitCode": "1b",
"value": "0.0lb"
}
},
{
"@type": "Offer",
"availability":"http://schema.org/InStock",
"price":"64.0",
"image":"http://foobar.gov/product/url",
"name":"Medium / Blue/Black/Cream Stripe",
"priceCurrency":"USD",
"url":"http://foobar.gov/product/url",
"additionalProperty": {
"@type": "PropertyValue",
"name": "Weight",
"unitCode": "1b",
"value": "0.0lb"
}
}]
}
Offer
上的 Googles Schema Documentation 声明 itemOffered
是推荐字段,它是 "typically a product",但不一定是。还值得注意的是,与文档相反,如果 Offer
中不存在 itemOffered
,该工具不会警告您
尽管 schema.org 提供了 itemsOffered
作为选项,但不幸的是,没有嵌套 Product
的示例。
嵌套 Products
或 Services
在以下情况下可能有意义:
- (产品)沙龙套餐
- (报价)Nail/Massage 组合
- (提供的项目)
- (服务)指甲抛光和颈部按摩
或:
- (产品)毛衣
- (优惠)蓝色毛衣
- (提供的项目)
- (产品) 蓝色毛衣
- (优惠)亚马逊上的蓝色毛衣 - 49 美元
- (优惠)eBay 上的蓝色毛衣 - 39 美元
- (优惠)红色毛衣
...
不管怎样,我认为这里的期望是有道理的,任何情况下的Product
最终都会以Offer
结束。在您的情况下,我相信解决方法是不使用嵌套 Product
s 仅描述 Offer
.
我在我维护的网站的产品页面上收到 Google 搜索控制台错误,我不确定如何解决这些错误。我得到的错误是:
One of offers or review or aggregateRating should be provided.
这很简单,可以正常修复,但是我的困惑是我已经在 json ld 的不同部分提供了 offers
数据。我的产品 json ld 的结构是
Product{
Offers{
Product {}
Product {}
}
}
其中嵌套产品是同一产品的不同变体。我在该网站上没有可用的评论或评分,因此我只能 offers
来解决错误。但是 google 搜索控制台说每个嵌套产品都应该有 offers
数据,尽管它们已经包含在报价结构中。
这似乎会陷入无限循环:我向产品变体添加报价,产品类型为 itemOffered,然后需要另一个报价,等等。
我如何组织我的结构化数据以支持我的产品 -> 变体层次结构,同时还取悦 google 搜索控制台并删除我看到的错误?
这是完整的 JSON ld,您可以直接 copy/paste 进入 Structured Data Testing Tool 以查看我正在描述的确切问题。
{
"@context":"http://schema.org/",
"@type":"Product",
"name":"Stripe Knit Sweater",
"url":"http://foobar.gov/product",
"image":[
"http://foobar.gov/product/image1"
],
"description":"this is a description",
"brand":{
"@type":"Thing",
"name":"My Store"
},
"offers":[
{
"@type":"Offer",
"availability":"http://schema.org/InStock",
"price":"64.0",
"priceCurrency":"USD",
"url":"http://foobar.gov/product/url",
"itemOffered":{
"@type":"Product",
/*ERROR IS HERE! : One of offers or review or aggregateRating should be provided.*/
"image":"http://foobar.gov/product/url",
"name":"Small / Blue/Black/Cream Stripe",
"weight":{
"@type":"QuantitativeValue",
"unitCode":"lb",
"value":"0.0 lb"
},
"url":"http://foobar.gov/product/url"
}
},
{
"@type":"Offer",
"availability":"http://schema.org/InStock",
"price":"64.0",
"priceCurrency":"USD",
"url":"http://foobar.gov/product/url",
"itemOffered":{
"@type":"Product",
/*ERROR IS HERE! : One of offers or review or aggregateRating should be provided.*/
"image":"http://foobar.gov/product/url",
"name":"Medium / Blue/Black/Cream Stripe",
"weight":{
"@type":"QuantitativeValue",
"unitCode":"lb",
"value":"0.0 lb"
},
"url":"http://foobar.gov/product/url"
}
}
]
}
根据您的示例,似乎每个 Offer
都是 Product
的变体。如果是这样的话,我不确定是否需要在变体中嵌套 Product
。据我从您的示例中可以看出,嵌套 Product
中唯一的 属性 是 weight
,您可以使用 additionalProperty
将其应用于 Offer
.
如果以这种方式发送到工具,一切都会生效:
{
"@context": "http://schema.org/",
"@type": "Product",
"name":"Stripe Knit Sweater",
"url":"http://foobar.gov/product",
"image":[
"http://foobar.gov/product/image1"
],
"description":"this is a description",
"brand":{
"@type":"Thing",
"name":"My Store"
},
"offers": [
{
"@type": "Offer",
"availability":"http://schema.org/InStock",
"price":"64.0",
"image":"http://foobar.gov/product/url",
"name":"Small / Blue/Black/Cream Stripe",
"priceCurrency":"USD",
"url":"http://foobar.gov/product/url",
"additionalProperty": {
"@type": "PropertyValue",
"name": "Weight",
"unitCode": "1b",
"value": "0.0lb"
}
},
{
"@type": "Offer",
"availability":"http://schema.org/InStock",
"price":"64.0",
"image":"http://foobar.gov/product/url",
"name":"Medium / Blue/Black/Cream Stripe",
"priceCurrency":"USD",
"url":"http://foobar.gov/product/url",
"additionalProperty": {
"@type": "PropertyValue",
"name": "Weight",
"unitCode": "1b",
"value": "0.0lb"
}
}]
}
Offer
上的 Googles Schema Documentation 声明 itemOffered
是推荐字段,它是 "typically a product",但不一定是。还值得注意的是,与文档相反,如果 Offer
itemOffered
,该工具不会警告您
尽管 schema.org 提供了 itemsOffered
作为选项,但不幸的是,没有嵌套 Product
的示例。
嵌套 Products
或 Services
在以下情况下可能有意义:
- (产品)沙龙套餐
- (报价)Nail/Massage 组合
- (提供的项目)
- (服务)指甲抛光和颈部按摩
- (提供的项目)
- (报价)Nail/Massage 组合
或:
- (产品)毛衣
- (优惠)蓝色毛衣
- (提供的项目)
- (产品) 蓝色毛衣
- (优惠)亚马逊上的蓝色毛衣 - 49 美元
- (优惠)eBay 上的蓝色毛衣 - 39 美元
- (产品) 蓝色毛衣
- (提供的项目)
- (优惠)红色毛衣 ...
- (优惠)蓝色毛衣
不管怎样,我认为这里的期望是有道理的,任何情况下的Product
最终都会以Offer
结束。在您的情况下,我相信解决方法是不使用嵌套 Product
s 仅描述 Offer
.