【问题标题】:Error: "The property offers is not recognized by Google for an object of type Offer" in Structured data错误:结构化数据中的“Google 无法识别商品类型对象的属性商品”
【发布时间】:2016-09-09 05:52:20
【问题描述】:

我已将以下 html 代码添加到我们网站之一的产品页面中:

<div itemtype="http://schema.org/Offer" itemscope="" itemprop="offers">
<div class="product-type-data">
    <div itemtype="http://schema.org/Offer" itemscope="" itemprop="offers" class="price-box">
        <span id="product-price-118" class="regular-price">
            <span itemprop="price" class="price">30,00&nbsp;€</span>  
        </span>                        
    </div>

    <p class="availability in-stock">Verfügbarkeit: <span>Auf Lager</span></p>
    <meta content="http://schema.org/InStock" itemprop="availability">
    <div class="clearfix"></div>
</div>                
<meta content="EUR" itemprop="priceCurrency">
<meta content="30" itemprop="price">            

在网站管理员工具中进行测试时,我在结构化数据中收到错误消息:“Google 无法识别该属性提供的类型为 Offer 的对象”(仅适用于具有类“price-box”的 div)。

我还在这里附上了网站管理员的错误快照。 有没有人能指出我出错的正确方向?

谢谢

【问题讨论】:

    标签: google-search-console structured-data


    【解决方案1】:

    您可以在https://schema.org/Product 和优惠https://schema.org/Offer 找到产品类型的 JSON+LD 示例,但这里有一个示例:

    <script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "Product",
      "aggregateRating": {
        "@type": "AggregateRating",
        "bestRating": "100",
        "ratingCount": "24",
        "ratingValue": "87"
      },
      "image": "dell-30in-lcd.jpg",
      "name": "Dell UltraSharp 30\" LCD Monitor",
      "offers": {
        "@type": "AggregateOffer",
        "highPrice": "$1495",
        "lowPrice": "$1250",
        "offerCount": "8",
        "offers": [
          {
            "@type": "Offer",
            "url": "save-a-lot-monitors.com/dell-30.html"
          },
          {
            "@type": "Offer",
            "url": "jondoe-gadgets.com/dell-30.html"
          }
        ]
      }
    }
    </script>
    

    【讨论】:

      【解决方案2】:

      我知道这是一个老问题,但我想回复一下,以防其他人需要答案。我还将假设报价是针对产品的(这不是必需的,但对大多数人来说可能很常见)。

      首先,我想参考一些资源来阅读有关该主题的内容。

      https://schema.org/

      Google Structured Data Test Tool

      Google Product Reference

      我还想澄清一下,这个问题与微数据有关,而不是 JSON-LD,所以我会用微数据格式来回答。

      我相信您的问题是“优惠”中有“优惠”。试试这个代码:

      <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
        <div class="product-type-data">
          <div class="price-box">
            <span id="product-price-118" class="regular-price">
              <span class="price">30,00&nbsp;€</span>  
            </span>                        
          </div>
          <p class="availability in-stock">Verfügbarkeit: <span>Auf Lager</span></p>
          <div class="clearfix"></div>
        </div>
        <meta content="http://schema.org/InStock" itemprop="availability">
        <meta content="30" itemprop="price">
        <meta content="EUR" itemprop="priceCurrency">
      </div>
      

      如果你把上面的代码放到google测试工具中,它就会验证。

      如果您想要另一个示例,请转到上面的 google 产品参考链接,然后在示例部分(单一产品页面)中,选择微数据选项卡,然后选择“查看标记”。这会给你一个更完整的例子。我已将其包含在下面,以防谷歌删除此代码。

      <div itemtype="http://schema.org/Product" itemscope>
        <meta itemprop="mpn" content="925872" />
        <meta itemprop="name" content="Executive Anvil" />
        <link itemprop="image" href="https://example.com/photos/16x9/photo.jpg" />
        <link itemprop="image" href="https://example.com/photos/4x3/photo.jpg" />
        <link itemprop="image" href="https://example.com/photos/1x1/photo.jpg" />
        <meta itemprop="description" content="Sleeker than ACME's Classic Anvil, the Executive Anvil is perfect for the business traveler looking for something to drop from a height." />
        <div itemprop="offers" itemtype="http://schema.org/Offer" itemscope>
          <link itemprop="url" href="https://example.com/anvil" />
          <meta itemprop="availability" content="https://schema.org/InStock" />
          <meta itemprop="priceCurrency" content="USD" />
          <meta itemprop="itemCondition" content="https://schema.org/UsedCondition" />
          <meta itemprop="price" content="119.99" />
          <meta itemprop="priceValidUntil" content="2020-11-05" />
          <div itemprop="seller" itemtype="http://schema.org/Organization" itemscope>
            <meta itemprop="name" content="Executive Objects" />
          </div>
        </div>
        <div itemprop="aggregateRating" itemtype="http://schema.org/AggregateRating" itemscope>
          <meta itemprop="reviewCount" content="89" />
          <meta itemprop="ratingValue" content="4.4" />
        </div>
        <div itemprop="review" itemtype="http://schema.org/Review" itemscope>
          <div itemprop="author" itemtype="http://schema.org/Person" itemscope>
            <meta itemprop="name" content="Fred Benson" />
          </div>
          <div itemprop="reviewRating" itemtype="http://schema.org/Rating" itemscope>
            <meta itemprop="ratingValue" content="4" />
            <meta itemprop="bestRating" content="5" />
          </div>
        </div>
        <meta itemprop="sku" content="0446310786" />
        <div itemprop="brand" itemtype="http://schema.org/Thing" itemscope>
          <meta itemprop="name" content="ACME" />
        </div>
      </div>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-06-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-06-15
        • 1970-01-01
        • 2021-09-27
        相关资源
        最近更新 更多