对于以下情况,我有一个关于使用结构化标记(Microdata/Schema.org)的正确方法的问题:我有一个主要概述产品,然后在其中有一个具有单独价格和自定义属性的模型列表。
简化示例:
<div class="mainproduct" itemscope itemtype="http://schema.org/Product">
<h1 itemprop="name">Product Name</h1>
<p itemprop="description">Lorem ipsum my description oh yay all hear this.</p>
<div class="modelslist" >
<div class="model" itemscope itemtype="http://schema.org/ProductModel">
<h2 itemprop="name">Model A</h2>
<span itemscope itemtype="http://schema.org/Offer">
<meta itemprop="price" content="£123" />
<span itemscope itemtype="http://schema.org/PriceSpecification">
<span itemprop="price">£123</span>
<meta itemprop="priceCurrency" content="GBP" />
<meta itemprop="valueAddedTaxIncluded" content="false" />
</span>
</span>
<span itemscope itemtype="http://schema.org/PropertyValue">
<meta itemprop="name" content="readability" />
<span itemprop="value">325</span>
</span>
</div>
<div class="model" itemscope itemtype="http://schema.org/ProductModel">
<h2 itemprop="name">Model B</h2>
<span itemscope itemtype="http://schema.org/Offer">
<meta itemprop="price" content="£456" />
<span itemscope itemtype="http://schema.org/PriceSpecification">
<span itemprop="price">£456</span>
<meta itemprop="priceCurrency" content="GBP" />
<meta itemprop="valueAddedTaxIncluded" content="false" />
</span>
</span>
<span itemscope itemtype="http://schema.org/PropertyValue">
<meta itemprop="name" content="readability" />
<span itemprop="value">325</span>
</span>
</div>
</div>
</div>
Q1。先指定价格然后再指定价格规范是否正确?如果没有元价格,Google 结构化数据测试工具会警告“报价”为空。
第二季度。如何指定“thingymabob”显示的自定义数据。我假设它与“additionalProperty”有关,但测试工具提示 Google 无法识别 ProductModel 类型的对象的“additionalProperty”。 (虽然看起来它来自http://schema.org/ProductModel)
更新
好的,这里是更新,定价现在全部为 tikity-boo,并且添加 itemprop="model"、itemprop="offers"和 itemprop="priceSpecification"都完成了正确的嵌套。
<div class="mainproduct" itemscope itemtype="http://schema.org/Product">
<h1 itemprop="name">Product Name</h1>
<p itemprop="description">Lorem ipsum my description oh yay all hear this.</p>
<div class="modelslist" >
<div class="model" itemprop="model" itemscope itemtype="http://schema.org/ProductModel">
<h2 itemprop="name">Model A</h2>
<span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="price" content="123" />
<meta itemprop="priceCurrency" content="GBP" />
<span itemprop="priceSpecification" itemscope itemtype="http://schema.org/UnitPriceSpecification">
£<span itemprop="price">123</span>
<meta itemprop="priceCurrency" content="GBP" />
<meta itemprop="valueAddedTaxIncluded" content="false" />
</span>
</span>
<span itemprop="additionalProperty" itemscope itemtype="http://schema.org/PropertyValue">
<meta itemprop="name" content="readability" />
<span itemprop="value">325</span>
</span>
</div>
<div class="model" itemprop="model" itemscope itemtype="http://schema.org/ProductModel">
<h2 itemprop="name">Model B</h2>
<span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="price" content="456" />
<meta itemprop="priceCurrency" content="GBP" />
<span itemprop="priceSpecification" itemscope itemtype="http://schema.org/UnitPriceSpecification">
£<span itemprop="price">456</span>
<meta itemprop="priceCurrency" content="GBP" />
<meta itemprop="valueAddedTaxIncluded" content="false" />
</span>
</span>
<span itemprop="additionalProperty" itemscope itemtype="http://schema.org/PropertyValue">
<meta itemprop="name" content="readability" />
<span itemprop="value">325</span>
</span>
</div>
</div>
</div>
只剩下向模型添加附加属性的问题了。从http://schema.org/ProductModel看来,additionalProperty应该没问题——只是Google目前不允许这样做吗?它确实在测试工具中返回此消息:“对于 ProductModel 类型的对象,Google 无法识别属性additionalProperty。”还有其他方法可以实现这一目标吗?
最佳答案
遗憾的是 Google 搜索 ( according to their documentation ) 仅支持 price
,不是priceSpecification
。我确信他们将来会支持它(如果还没有这种情况,尽管没有记录)。
提供这两个属性似乎是一个合适的解决方案,特别是在您没有的简单情况下,e.g., a monthly fee .
关于您的价格加价:
priceSpecification
属性(引用PriceSpecification
)丢失您可能想要使用
UnitPriceSpecification
而不是PriceSpecification
,如it says forPriceSpecification
:Typically, only the subclasses of this type are used for markup.
price
值不应包含货币;使用priceCurrency
相反
因此您的标记可能如下所示:
<span itemscope itemtype="http://schema.org/Offer">
<meta itemprop="price" content="123" />
<meta itemprop="priceCurrency" content="GBP" />
<span itemprop="priceSpecification" itemscope itemtype="http://schema.org/UnitPriceSpecification">
£<span itemprop="price">123</span>
<meta itemprop="priceCurrency" content="GBP" />
<meta itemprop="valueAddedTaxIncluded" content="false" />
</span>
</span>
(请注意,您还应该使用属性从其所属的产品中引用此Offer
。)
关于schema.org - 结构化标记将模型添加到产品数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30711198/