Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google SDTT中的错误:“0”;为url提供的所有值必须指向同一页。”;_Url_Schema.org_Json Ld_Google Rich Snippets - Fatal编程技术网

Google SDTT中的错误:“0”;为url提供的所有值必须指向同一页。”;

Google SDTT中的错误:“0”;为url提供的所有值必须指向同一页。”;,url,schema.org,json-ld,google-rich-snippets,Url,Schema.org,Json Ld,Google Rich Snippets,我正在尝试为ecom站点上的产品列表创建一些JSON-LD结构化数据,但在使用Google的结构化数据测试工具时,我遇到了一个错误 到目前为止,我有: { “@context”:”http://schema.org", “@type”:“OfferCatalog”, “名称”:“新鲜水果”, “itemListElement”:[ { “@type”:“ListItem”, "立场":一,, “项目”: { “@type”:“Offer”, “价格”:“1.20”, “价格货币”:“英镑”, “

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

到目前为止,我有:

{
“@context”:”http://schema.org",
“@type”:“OfferCatalog”,
“名称”:“新鲜水果”,
“itemListElement”:[
{
“@type”:“ListItem”,
"立场":一,,
“项目”:
{
“@type”:“Offer”,
“价格”:“1.20”,
“价格货币”:“英镑”,
“可用性”:http://schema.org/InStock",
“url”:”http://example.com/green-apples/",
“提供的项目”:{
“@type”:“产品”,
“名称”:“青苹果”,
“url”:”http://example.com/green-apples/"
}
}        
}  
]
}
大多数情况下,它会进行验证,但Google工具会抛出以下错误:

为url提供的所有值必须指向同一页

错误突出显示第11行(
“@type”:“Offer”,

URL字段似乎与
@context
声明冲突,因为如果我将上下文更改为非URL字符串或
http://example.com
,它进行验证(尽管这显然会导致自身的问题)。(在下面的评论中,这已被证明是一种转移注意力的做法)


我错过了什么?这感觉像是非常明显的事情。

这肯定是验证器中的错误。我查看了谷歌提供的示例:。 如果你点击第二个例子,你会看到它有同样的错误

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

{
  "@context": "http://schema.org",
  "@type": "ItemList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "item": {
        "@type": "Recipe",
        "url": "http://example.com/desserts/pies/#apple-pie",
        "name": "Apple Pie",
        "image": "https://example.com/300px-Apple_pie.jpg",
        "author": {
          "@type": "Person",
          "name": "Carol Smith"
        },
        "datePublished": "2009-11-05"
      }
    }
  ]
}

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

请在这里查看我的想法:。我的猜测是关于谷歌SDTT的问题

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

  • 如果您的项目在同一页上,请使用项目的版本 里面是一个组合的

  • 否则,如果您指向内部的不同页面,并且您的项目 不在一页上,请不要放置类型为和其他 内有说明,单独标记的一个


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

谷歌在第页声明-

  • 如果这是一个摘要页面,则列表项应仅包括类型位置url属性
  • 如果这是一个多页列表,列表项应该包括它所描述的数据类型(例如,配方或课程对象)的所有附加属性
但是谷歌应该考虑电子商务类的产品上市,人们在年份页面上展示超过3个属性的产品,这些对于电子商务来说是显而易见的,价格和图像是产品列表页面上的2个重要项目,除了上面列出的3个之外。
所以我们需要向谷歌提出这个问题来解决这个问题

不,这不是谷歌SDTT中的错误

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

这意味着“嘿,您使用的是与我们提供的示例不同的项目列表,您的项目列表有两个以上的项目”

解决方案:

使用锚!瞧

请使用这个示例片段,您不会出错。还有一个提示;使用SDTT中的获取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>

/*由编译的structerd数据标记http://www.iwanross.co.za */
{
“@context”:”http://schema.org",  
“@type”:“ItemList”,
“itemListElement”:[
{
“@type”:“ListItem”,
"立场":一,,
“项目”:{
“@type”:“菜谱”,
“url”:”https://www.smokingchimney.com/#beetroot",
“名称”:“甜菜根沙拉配布劳”,
“图像”:http://www.smokingchimney.com/recipe-pages/images/1x1/Beetroot-Salad- 
对于-the-Braai-800x451.jpg“,
“作者”:{
“@type”:“Person”,
“姓名”:“玛娜·罗斯”
},
“发布日期”:“2018-10-05”
}
},
{
“@type”:“ListItem”,
"立场":二,,
“项目”:{
“@type”:“菜谱”,
“url”:”https://www.smokingchimney.com/#carrot",
“名称”:“胡萝卜蛋糕”,
“图像”:http://www.smokingchimney.com/recipe-pages/images/16x9/carrot-cake- 
recipe-picture-1024x576.jpg“,
“作者”:{
“@type”:“Person”,
“姓名”:“玛娜·罗斯”
},
“发布日期”:“2018-10-05”
}
},
{
“@type”:“ListItem”,
“立场”:3,
“项目”:{
“@type”:“菜谱”,
“url”:”https://www.smokingchimney.com/#overnight",
“名称”:“隔夜牛排卤汁”,
“图像”:http://www.smokingchimney.com/recipe-pages/images/1x1/Overnight-steak- 
腌汁-700x465.png“,
“作者”:{
“@type”:“Person”,
“姓名”:“玛娜·罗斯”
},
“发布日期”:“2009-10-05”
}
}
]
}
现在是2018年

上面Yash Pal的回答很接近,但不完全正确

这不是来自谷歌验证器工具的错误

错误是有效的,您需要修复它

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

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

谷歌开发者文档明确提到了这一点

我写了详细的解释

如果您的页面包含指向其他页面的链接,那么您应该使用“摘要页面”方法,并且它具有不同的数据结构(我认为更简单)