2015-10-14 78 views
0

我想爲谷歌SERPS中的產品頁面製作豐富網頁摘要。這是一個爲頁面:如何使用適用於多產品頁面的JSON-LD代碼啓用豐富網頁摘要?

  • 包含多個產品,每個有個別價格
  • 的平均總得分

據我知道這是可能的多種產品添加到一個頁面中模式org使用多個優惠。問題是我找不到使用JSON-LD的文檔。我在下面的代碼中自己嘗試過,但不知道這是否正確。我可以添加這樣的優惠還是需要以不同的方式添加優惠?

<script type="application/ld+json"> 
{ 
"@context": "http://schema.org/", 
"@type": "Product", 
"aggregateRating": { 
    "@type": "AggregateRating", 
    "ratingValue": "[rating variable]", 
    "reviewCount": "[count variable]" 
}, 
"name": "[product name]", 
"offers": { 
    "@type": "Offer", 
    "price": "[price of product]", 
    "priceCurrency": "[currency]" 
}, 
"name": "[product name]", 
"offers": { 
    "@type": "Offer", 
    "price": "[price of product]", 
    "priceCurrency": "[currency]" 
}, 
"name": "[product name]", 
"offers": { 
    "@type": "Offer", 
    "price": "[price of product]", 
    "priceCurrency": "[currency]" 
}, 
} 
</script> 
+1

有些引號是錯誤的('''而不是''') – unor

+0

謝謝Unor。馬虎的錯誤。 – Stijn

回答

2

只是創建一個數組。

<script type="application/ld+json"> 
{ 
    "@context": "http://schema.org/", 
    "@type": "Product", 
    "name": "[name]", 
    "image": "[logo]", 
    "aggregateRating": { 
    "@type": "AggregateRating", 
    "ratingValue": "[rating], 
    "reviewCount": "[votes]" 
    }, 
    "offers": [{ 
    "@type": "Offer", 
    "priceCurrency": "[currency]", 
    "price": "[price]", 
    "category": { 
     "@type": "thing", 
     "name": "[name product]" 
    } 
    },{ 
    "@type": "Offer", 
    "priceCurrency": "[currency]", 
    "price": "[price]", 
    "category": { 
     "@type": "thing", 
     "name": "[name product]" 
    } 
    },{ 
    "@type": "Offer", 
    "priceCurrency": "[currency]", 
    "price": "[price]", 
    "Category": { 
     "@type": "thing", 
     "name": "[name product]" 
    } 
    }] 
} 
</script> 
相關問題