SDTT错误:“位置字段的值是必需的。”

时间:2019-07-23 23:10:37

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

我在Google结构化数据测试工具中收到一条错误消息,表明我缺少结构化数据的position值:

  

需要position字段的值。

我似乎无法弄清楚它应该在哪里。我尝试在多个位置添加position值。

{
    "@context": "http://schema.org",
    "@type": "ItemList",
    "numberOfItems": "5",
    "url": "https://www.mygiftcardsplus.com/buy/merchant/id/Nik#GiftCardItemList ~~~ named location on the page",
    "itemListElement": [
        {
            "@type": "Product",
            "image": "https://d3bvejazygcenf.cloudfront.net/images/merchant/14597-90617-b16b-5a17/300x190.png",
            "url": "https://www.mygiftcardsplus.com/buy/merchant/id/Nik#25GiftCard ~~~ named location on the page",
            "name": "$25 Nike Gift Card",
            "description": "Get 5% cash back on a $25 Nike Gift Card",
            "offers": {
                "@type": "Offer",
                "price": "25",
                "priceCurrency": "USD"
            }
        },
        {
            "@type": "Product",
            "image": "https://d3bvejazygcenf.cloudfront.net/images/merchant/14597-90617-b16b-5a17/300x190.png",
            "url": "https://www.mygiftcardsplus.com/buy/merchant/id/Nik#50GiftCard ~~~ named location on the page",
            "name": "$50 Nike Gift Card",
            "description": "Get 5% cash back on a $50 Nike Gift Card",
            "offers": {
                "@type": "Offer",
                "price": "50",
                "priceCurrency": "USD"
            }
        },
                {
            "@type": "Product",
            "image": "https://d3bvejazygcenf.cloudfront.net/images/merchant/14597-90617-b16b-5a17/300x190.png",
            "url": "https://www.mygiftcardsplus.com/buy/merchant/id/Nik#150GiftCard ~~~ named location on the page",
            "name": "$150 Nike Gift Card",
            "description": "Get 5% cash back on a $150 Nike Gift Card",
            "offers": {
                "@type": "Offer",
                "price": "150",
                "priceCurrency": "USD"
            }
        }
    ]
}

1 个答案:

答案 0 :(得分:1)

可以将position添加到CreativeWorkListItem个项目。

如果要提供产品在列表中的位置,可以使用ListItem类型并通过item指定Product

"itemListElement": [

  {
    "@type": "ListItem",
    "position": 1,
    "item": {
      "@type": "Product"
    }
  },

  {
    "@type": "ListItem",
    "position": 2,
    "item": {
      "@type": "Product"
    }
  }

]