Google SDTT中的错误:"为网址提供的所有值都必须指向同一页面。"

时间:2016-10-21 15:41:00

标签: url schema.org json-ld google-rich-snippets

我正在尝试为ecom网站上的产品列表创建一些JSON-LD结构化数据,但在使用Google的结构化数据测试工具时出现错误。

到目前为止,我有这个:

 {
 "@context": "http://schema.org",
 "@type": "OfferCatalog",
 "name": "Fresh Fruit",
 "itemListElement": [
  {
   "@type": "ListItem",
   "position": 1,
   "item":
   {
        "@type": "Offer",
        "price": "1.20",
        "priceCurrency": "GBP",
        "availability": "http://schema.org/InStock",
        "url": "http://example.com/green-apples/",
        "itemOffered": {
            "@type": "Product",
            "name": "Green Apples",
            "url": "http://example.com/green-apples/"
            }
        }        
   }  
 ]
}

主要是验证,但Google工具会抛出以下错误:

  

为网址提供的所有值都必须指向同一页面。

错误突出显示第11行("@type": "Offer",)。

URL字段似乎与@context声明冲突,因为如果我将上下文更改为非url字符串或http://example.com,它会验证(尽管这显然会导致它自己的问题。)(这已被证明是一个红鲱鱼,在下面的评论中)

我在这里缺少什么?感觉就像是一件非常明显的事情。

7 个答案:

答案 0 :(得分:6)

我认为这与加速移动网页及其结构化数据的推动有关。

请在这里查看我的想法:All values provided for URL must point to the same page。我的猜测是关于谷歌SDTT中的问题

因此,要修复结构数据的问题,请使用正确版本的ItemList(有单独和组合标记的ItemLists,请检查here):

  • 如果您的商品位于同一页面上,请使用包含商品的版本 在里面,合并的。

  • 否则,如果您指向内部的不同页面并且您的项目是 不要在一页上,请不要把项目元素与类型和其他 里面的描述,单独标记了一个。

答案 1 :(得分:2)

我认为当我们混合两种列表类型时会出现问题,即摘要页面+多个完整详细信息页面和单个一页一页列表。

Google在页面上说明了https://developers.google.com/search/docs/guides/mark-up-listings

  • 如果这是摘要页 ListItem应仅包含 类型排名网址属性。
  • 如果这是一体化列表, ListItem应包含其描述的数据类型的所有其他 schema.org属性(适用于例如,食谱或课程对象)。

但谷歌应该考虑电子商务类别的产品列表,其中人们在夏季页面上显示超过3个属性的产品数量,这些对于电子商务来说是显而易见的,如价格和图像是产品列表页面上的2个重要项目,除了上面列出了3个。

因此,我们需要向Google提出此问题以解决问题。

答案 2 :(得分:2)

现在是2018年。

上面的Yash Pal回答很近,但不太正确。

这不是Google验证工具的错误。

该错误有效,您需要对其进行修复。

您使用“单页”方法(有两种方法“摘要页”和“单页”)

对于“单页”方法,您需要每个URL完全相同,并且每个URL都应具有“锚点”。

Google开发人员文档中明确提到了它。

我写了解释详细信息there

如果您的页面包含指向另一页面的某些链接,则应使用“摘要页面”方法,并且它具有不同的数据结构(我认为要简单得多)

答案 3 :(得分:1)

验证器肯定是错误的。我查看了谷歌提供的示例:https://developers.google.com/search/docs/guides/mark-up-listings。 如果单击第二个示例,您将看到它具有相同的错误。

即使您使用1项也会显示错误:

/index.php

答案 4 :(得分:1)

否,这是,是Google SDTT中的错误,

我已经帮助许多人修复了他们的结构化数据,包括动态数组。阅读说明书。 Google明确指出“ URL的所有值都必须指向同一页面”。想想看,Google正在尝试告诉您一些事情。

这意味着“您使用的商品清单与我们提供的示例不同,您的商品清单有两个以上商品。”

解决方案:

使用锚点!瞧!

请使用此示例代码段,您不会出错。还有一个提示使用SDTT中的Fetch Url选项:

<script type="application/ld+json">
/*structerd data markup compiled by http://www.iwanross.co.za */
{
"@context": "http://schema.org",  
"@type": "ItemList",
"itemListElement": [
{
    "@type": "ListItem",
    "position": 1,
    "item": {
    "@type": "Recipe",
    "url": "https://www.smokingchimney.com/#beetroot",
    "name": "Beetroot Side Salad for the braai",
    "image": "http://www.smokingchimney.com/recipe-pages/images/1x1/Beetroot-Salad- 
  for-the-Braai-800x451.jpg",
    "author": {
    "@type": "Person",
    "name": "Marna Ross"
   },
  "datePublished": "2018-10-05"
  }
},
{
  "@type": "ListItem",
  "position": 2,
  "item": {
    "@type": "Recipe",
    "url": "https://www.smokingchimney.com/#carrot",
    "name": "Carrot Cake",
    "image": "http://www.smokingchimney.com/recipe-pages/images/16x9/carrot-cake- 
 recipe-picture-1024x576.jpg",
    "author": {
    "@type": "Person",
    "name": "Marna Ross"
   },
  "datePublished": "2018-10-05"
 }
},
{
  "@type": "ListItem",
  "position": 3,
  "item": {
    "@type" : "Recipe",
    "url":"https://www.smokingchimney.com/#overnight",
    "name": "Overnight Steak Marinade",
    "image": "http://www.smokingchimney.com/recipe-pages/images/1x1/Overnight-steak- 
 marinade-700x465.png",
    "author": {
    "@type": "Person",
    "name": "Marna Ross"
   },
   "datePublished": "2009-10-05"
   }
   }
 ]
}
</script>

答案 5 :(得分:0)

您不需要锚定每个URL,也可以向URL添加参数?i = 1

喜欢:

https://website.com/d/link?i=1

https://website.com/d/link?i=2 ....

答案 6 :(得分:-2)

使用类型OfferCatalog代替ItemList。 https://schema.org/OfferCatalog