我有以下JSON-LD,并试图代表按月付费产品,例如包含预付费用和月租费用的手机合同。
当我尝试添加unitCode
时,出现以下警告:
对于
priceSpecification
类型的对象,Google无法识别属性Product
。
{
"@context": "https://schema.org/",
"@type": "Product",
"name": "Apple iPhone",
"image": [
"https://example.com/photos/1x1/photo.jpg",
"https://example.com/photos/4x3/photo.jpg",
"https://example.com/photos/16x9/photo.jpg"
],
"description": "Apple iPhone XS ...",
"sku": "0446310786",
"mpn": "925872",
"brand": {
"@type": "Thing",
"name": "ACME"
},
"review": {
"@type": "Review",
"reviewRating": {
"@type": "Rating",
"ratingValue": "4",
"bestRating": "5"
},
"author": {
"@type": "Person",
"name": "Fred Benson"
}
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.4",
"reviewCount": "89"
},
"offers": {
"@type": "Offer",
"url": "https://example.com/anvil",
"priceCurrency": "GBP",
"price": "39.99",
"priceValidUntil": "2020-11-05",
"itemCondition": "https://schema.org/UsedCondition",
"availability": "https://schema.org/InStock",
"seller": {
"@type": "Organization",
"name": "Executive Objects"
}
},
"priceSpecification": {
"@type": "UnitPriceSpecification",
"price": "25",
"priceCurrency": "GBP",
"referenceQuantity": {
"unitCode": "MON"
}
}
}
答案 0 :(得分:1)
您需要将priceSpecification
属性添加到Offer
,而不是Product
。
{
"@context": "https://schema.org/",
"@type": "Product",
"offers": {
"@type": "Offer",
"priceSpecification": {
"@type": "UnitPriceSpecification"
}
}
}
您可以在其页面上找到属性的预期域/范围。对于priceSpecification
,它表示:
在这些类型上使用
Demand
Offer
TradeAction
因此,Product
上不会出现这种情况。