產品子類結構化資料 (ProductGroup
、Product
)
許多種類的產品,例如服裝、鞋子、家具、電子裝置和行李箱,都是以不同的變化形式銷售 (例如各種尺寸、顏色、材料或圖案)。為協助 Google 更充分瞭解哪些產品是同一父項產品的子類,除了 Product
結構化資料外,請使用類別 ProductGroup
與相關屬性 variesBy
、hasVariant
與 productGroupID
,將這類的子類歸為一組。
ProductGroup
還可以讓您為所有子類指定共同的產品屬性 (例如品牌和評論資訊),以及用來確定子類的屬性,進而減少資訊重複的情形。
如何新增結構化資料
結構化資料是一種標準化格式,能夠提供網頁相關資訊並分類網頁內容。如果您是第一次使用結構化資料,請參閱這篇文章,進一步瞭解結構化資料的運作方式。
以下簡要說明如何建立、測試及發布結構化資料。
- 新增必要屬性。根據您使用的格式,瞭解要在網頁中的什麼位置插入結構化資料。
- 遵循指南規範。
- 使用複合式搜尋結果測試驗證程式碼,並修正所有重大錯誤。此外,我們也建議您修正工具中可能標記的任何非重大問題,因為這有助於改善結構化資料的品質 (但並非符合複合式搜尋結果的顯示條件)。
- 部署幾個包含結構化資料的網頁,並使用網址檢查工具測試 Google 轉譯網頁的情形。請確認 Google 可以存取您的網頁,且網頁並未遭到 robots.txt 檔案或
noindex
標記封鎖,也未設有登入規定。如果網頁看起來沒問題,您可以要求 Google 重新檢索您的網址。 - 為了讓 Google 掌握日後的異動內容,建議您提交 Sitemap。您可以使用 Search Console Sitemap API 自動執行這項操作。
範例
一般來說,電子商務網站使用兩種主要設計方法來設定產品子類。本節說明如何根據網站設計方式來設定產品子類標記:
單頁網站
此單頁網站範例假設網站滿足以下條件:
- 如果未選取任何子類,下列網址會傳回主要產品頁面:
https://www.example.com/coat
- 系統會使用下列網址,傳回包含特定、預先選取子類的相同網頁:
https://www.example.com/coat?size=small&color=green
https://www.example.com/coat?size=small&color=lightblue
https://www.example.com/coat?size=large&color=lightblue
- 當使用者在網頁上選取其他子類 (使用顏色和大小下拉式選單) 時,圖片、價格和供應情形資訊會動態變更,而不會重新載入網頁。網頁上的標記不會隨著使用者選擇不同子類而動態變更。
單頁範例:子類在 ProductGroup
底下形成巢狀結構
在這個範例中,子類是使用 hasVariant
屬性,在頂層 ProductGroup
實體底下形成巢狀結構:
ProductGroup
和三個Offer
實體 (在Product
屬性底下) 都擁有不同的網址。或者,也可以在Product
底下提供這些網址。- 常見的標題和說明是在
ProductGroup
層級指定。子類專屬的標題和說明是在Product
層級指定。 - 其他常見的子類屬性 (例如品牌、圖案、材質和目標對象資訊) 也是在
ProductGroup
層級指定。 ProductGroup
使用variesBy
屬性指定子類識別屬性。ProductGroup
使用productGroupID
指定父項 SKU (無須使用inProductGroupWithID
在Product
屬性下重複)。
建議您採用這種方式,因為這是產品群組及其子類最密集且自然的表示方式。
<html> <head> <title>Wool winter coat</title> <script type="application/ld+json"> [ { "@context": "https://schema.org/", "@type": "ProductGroup", "name": "Wool winter coat", "description": "Wool coat, new for the coming winter season", "url": "https://www.example.com/coat", "brand": { "@type": "Brand", "name": "Good brand" }, "audience": { "@type": "PeopleAudience", "suggestedGender": "unisex", "suggestedAge": { "@type": "QuantitativeValue", "minValue": 13, "unitCode": "ANN" } }, "productGroupID": "44E01", "pattern": "striped", "material": "wool", "variesBy": [ "https://schema.org/size", "https://schema.org/color" ], "hasVariant": [ { "@type": "Product", "sku": "44E01-M11000", "gtin14": "98766051104214", "image": "https://www.example.com/coat_small_green.jpg", "name": "Small green coat", "description": "Small wool green coat for the winter season", "color": "Green", "size": "small", "offers": { "@type": "Offer", "url": "https://www.example.com/coat?size=small&color=green", "priceCurrency": "USD", "price": 39.99, "itemCondition": "https://schema.org/NewCondition", "availability": "https://schema.org/InStock", "shippingDetails": { "@id": "#shipping_policy" }, "hasMerchantReturnPolicy": { "@id": "#return_policy" } } }, { "@type": "Product", "sku": "44E01-K11000", "gtin14": "98766051104207", "image": "https://www.example.com/coat_small_lightblue.jpg", "name": "Small light blue coat", "description": "Small wool light blue coat for the winter season", "color": "light blue", "size": "small", "offers": { "@type": "Offer", "url": "https://www.example.com/coat?size=small&color=lightblue", "priceCurrency": "USD", "price": 39.99, "itemCondition": "https://schema.org/NewCondition", "availability": "https://schema.org/InStock", "shippingDetails": { "@id": "#shipping_policy" }, "hasMerchantReturnPolicy": { "@id": "#return_policy" } } }, { "@type": "Product", "sku": "44E01-X1100000", "gtin14": "98766051104399", "image": "https://www.example.com/coat_large_lightblue.jpg", "name": "Large light blue coat", "description": "Large wool light blue coat for the winter season", "color": "light blue", "size": "large", "offers": { "@type": "Offer", "url": "https://www.example.com/coat?size=large&color=lightblue", "priceCurrency": "USD", "price": 49.99, "itemCondition": "https://schema.org/NewCondition", "availability": "https://schema.org/Backorder", "shippingDetails": { "@id": "#shipping_policy" }, "hasMerchantReturnPolicy": { "@id": "#return_policy" } } } ] }, { "@context": "https://schema.org/", "@type": "OfferShippingDetails", "@id": "#shipping_policy", "shippingRate": { "@type": "MonetaryAmount", "value": 2.99, "currency": "USD" }, "shippingDestination": { "@type": "DefinedRegion", "addressCountry": "US" }, "deliveryTime": { "@type": "ShippingDeliveryTime", "handlingTime": { "@type": "QuantitativeValue", "minValue": 0, "maxValue": 1, "unitCode": "DAY" }, "transitTime": { "@type": "QuantitativeValue", "minValue": 1, "maxValue": 5, "unitCode": "DAY" } } }, { "@context": "http://schema.org/", "@type": "MerchantReturnPolicy", "@id": "#return_policy", "applicableCountry": "US", "returnPolicyCategory": "https://schema.org/MerchantReturnFiniteReturnWindow", "merchantReturnDays": 60, "returnMethod": "https://schema.org/ReturnByMail", "returnFees": "https://schema.org/FreeReturn" } ] </script> </head> <body> </body> </html>
單頁範例:子類與 ProductGroup
分離
這個結構與前一個範例類似,差別在於子類是與 ProductGroup
分開定義 (非巢狀結構)。對某些內容管理系統 (CMS) 而言,這種方法可能更容易產生。
<html> <head> <title>Wool winter coat</title> <script type="application/ld+json"> [ { "@context": "https://schema.org", "@type": "ProductGroup", "@id": "#coat_parent", "name": "Wool winter coat", "description": "Wool coat, new for the coming winter season", "url": "https://www.example.com/coat", ... // Other ProductGroup-level properties "brand": { "@type": "Brand", "name": "Good brand" }, "productGroupID": "44E01", "variesBy": [ "https://schema.org/size", "https://schema.org/color" ] }, { "@context": "https://schema.org", "@type": "Product", "isVariantOf": { "@id": "#coat_parent" }, "name": "Small green coat", "description": "Small wool green coat for the winter season", ... // Other Product-level properties "offers": { "@type": "Offer", "url": "https://www.example.com/coat?size=small&color=green", "price": 39.99 ... // Other offer-level properties } }, { "@context": "https://schema.org", "@type": "Product", "isVariantOf": { "@id": "#coat_parent" }, "name": "Small dark blue coat", "description": "Small wool light blue coat for the winter season", ... // Other Product-level properties "offers": { "@type": "Offer", "url": "https://www.example.com/coat?size=small&color=lightblue", "price": 39.99 ... // Other offer-level properties } }, { "@context": "https://schema.org", "@type": "Product", "isVariantOf": { "@id": "#coat_parent" }, "name": "Large dark blue coat", "description": "Large wool light blue coat for the winter season", ... // Other Product-level properties "offers": { "@type": "Offer", "url": "https://www.example.com/coat?size=large&color=lightblue", "price": 49.99 ... // Other offer-level properties } } ] </script> </head> <body> </body> </html>
多頁網站
多頁網站標記範例假設網站滿足以下條件:
- 淺藍色子類可以在下列網址找到 (適用於大小尺寸):
https://www.example.com/coat/lightblue?size=small
https://www.example.com/coat/lightblue?size=large
- 綠色子類只能在
https://www.example.com/coat/green?size=small
找到 (小尺寸)。 - 這兩個網頁都允許透過使用者介面中的顏色選取器「跳轉」至另一個網頁 (也就是重新載入網頁)。
- 該網站將單頁範例中的對等標記拆分到兩個網頁中。
請注意,只有一個頁面沒有 ProductGroup
定義,而這個頁面又被另一個頁面參照。這是因為 ProductGroup
需要參照子類的通用屬性,例如品牌、材質和年齡層。也就是說,需要在每個子類頁面上重複完整的 ProductGroup
定義。
多頁範例:子類在 ProductGroup
底下形成巢狀結構
這相當於第一個單頁範例,其中子類 Product
屬性是使用 hasVariant
屬性,在頂層 ProductGroup
實體底下形成巢狀結構。這兩個頁面上的 ProductGroup
定義是重複的。請注意下列事項:
ProductGroup
沒有標準網址,因為沒有代表ProductGroup
的單一網址。- 每個網頁上的
ProductGroup
都具有相應網頁上子類的完整定義,以及一個只有url
屬性的子類可連結至其他網頁上的子類,這有助於 Google 找出您的子類。
第 1 頁:淺藍色子類
以下範例在第一頁顯示淺藍色子類的結構化資料:
<html> <head> <title>Wool winter coat, light blue color</title> <script type="application/ld+json"> [ { "@context": "https://schema.org/", "@type": "ProductGroup", "name": "Wool winter coat", "description": "Wool coat, new for the coming winter season", ... // Other ProductGroup-level properties "brand": { "@type": "Brand", "name": "Good brand" }, "productGroupID": "44E01", "variesBy": [ "https://schema.org/size", "https://schema.org/color" ], "hasVariant": [ { "@type": "Product", "name": "Small light blue coat", "description": "Small wool light blue coat for the winter season", ... // Other Product-level properties "offers": { "@type": "Offer", "url": "https://www.example.com/coat/lightblue?size=small", "price": 39.99 ... // Other offer-level properties } }, { "@type": "Product", "name": "Large light blue coat", "description": "Large wool light blue coat for the winter season", ... // Other Product-level properties "offers": { "@type": "Offer", "url": "https://www.example.com/coat/lightblue?size=large", "price": 49.99 ... // Other offer-level properties } }, { "url": "https://www.example.com/coat/green?size=small" } ] } ] </script> </head> <body> </body> </html>
第 2 頁:綠色子類
以下範例在第二頁顯示綠色子類的結構化資料:
<html> <head> <title>Wool winter coat, green color</title> <script type="application/ld+json"> [ { "@context": "https://schema.org/", "@type": "ProductGroup", "name": "Wool winter coat", "description": "Wool coat, new for the coming winter season", ... // Other ProductGroup-level properties "brand": { "@type": "Brand", "name": "Good brand" }, "productGroupID": "44E01", "variesBy": [ "https://schema.org/size", "https://schema.org/color" ], "hasVariant": [ { "@type": "Product", "name": "Small green coat", "description": "Small wool green coat for the winter season", ... // Other Product-level properties "offers": { "@type": "Offer", "url": "https://www.example.com/coat/green?size=small", "price": 39.99, ... // Other offer-level properties } }, { "url": "https://www.example.com/coat/lightblue?size=small" }, { "url": "https://www.example.com/coat/lightblue?size=large" } ] } ] </script> </head> <body> </body> </html>
多頁範例:子類與 ProductGroup
分離
這個結構與先前的多頁範例類似,差別在於子類是與 ProductGroup
分開定義 (非巢狀結構)。對某些 CMS 而言,這種方法可能更容易產生。
第 1 頁:淺藍色子類
以下範例在第一頁顯示淺藍色子類的結構化資料:
<html> <head> <title>Wool winter coat, lightblue color</title> <script type="application/ld+json"> [ { "@context": "https://schema.org/", "@type": "ProductGroup", "@id": "#coat_parent", "name": "Wool winter coat", "description": "Wool coat, new for the coming winter season", "brand": { "@type": "Brand", "name": "Good brand" }, "audience": { "@type": "PeopleAudience", "suggestedGender": "unisex", "suggestedAge": { "@type": "QuantitativeValue", "minValue": 13, "unitCode": "ANN" } }, "productGroupID": "44E01", "pattern": "striped", "material": "wool", "variesBy": [ "https://schema.org/size", "https://schema.org/color" ] }, { "@context": "https://schema.org", "@type": "Product", "isVariantOf": { "@id": "#coat_parent" }, "sku": "44E01-K11000", "gtin14": "98766051104207", "image": "https://www.example.com/coat_lightblue.jpg", "name": "Small light blue coat", "description": "Small wool light blue coat for the winter season", "color": "light blue", "size": "small", "offers": { "@type": "Offer", "url": "https://www.example.com/coat/lightblue?size=small", "priceCurrency": "USD", "price": 39.99, "itemCondition": "https://schema.org/NewCondition", "availability": "https://schema.org/InStock", "shippingDetails": { "@id": "#shipping_policy" }, "hasMerchantReturnPolicy": { "@id": "#return_policy" } } }, { "@context": "https://schema.org", "@type": "Product", "isVariantOf": { "@id": "#coat_parent" }, "sku": "44E01-X1100000", "gtin14": "98766051104399", "image": "https://www.example.com/coat_lightblue.jpg", "name": "Large light blue coat", "description": "Large wool light blue coat for the winter season", "color": "light blue", "size": "large", "offers": { "@type": "Offer", "url": "https://www.example.com/coat/lightblue?size=large", "priceCurrency": "USD", "price": 49.99, "itemCondition": "https://schema.org/NewCondition", "availability": "https://schema.org/Backorder", "shippingDetails": { "@id": "#shipping_policy" }, "hasMerchantReturnPolicy": { "@id": "#return_policy" } } }, { "@context": "https://schema.org", "@type": "Product", "isVariantOf": { "@id": "#coat_parent" }, "url": "https://www.example.com/coat/green?size=small" }, { "@context": "https://schema.org/", "@type": "OfferShippingDetails", "@id": "#shipping_policy", "shippingRate": { "@type": "MonetaryAmount", "value": 2.99, "currency": "USD" }, "shippingDestination": { "@type": "DefinedRegion", "addressCountry": "US" }, "deliveryTime": { "@type": "ShippingDeliveryTime", "handlingTime": { "@type": "QuantitativeValue", "minValue": 0, "maxValue": 1, "unitCode": "DAY" }, "transitTime": { "@type": "QuantitativeValue", "minValue": 1, "maxValue": 5, "unitCode": "DAY" } } }, { "@context": "https://schema.org/", "@type": "MerchantReturnPolicy", "@id": "#return_policy", "applicableCountry": "US", "returnPolicyCategory": "https://schema.org/MerchantReturnFiniteReturnWindow", "merchantReturnDays": 60, "returnMethod": "https://schema.org/ReturnByMail", "returnFees": "https://schema.org/FreeReturn" } ] </script> </head> <body> </body> </html>
第 2 頁:綠色子類
以下範例在第二頁顯示綠色子類的結構化資料:
<html> <head> <title>Wool winter coat, green color</title> <script type="application/ld+json"> [ { "@context": "https://schema.org/", "@type": "ProductGroup", "@id": "#coat_parent", "name": "Wool winter coat", "description": "Wool coat, new for the coming winter season", "brand": { "@type": "Brand", "name": "Good brand" }, "audience": { "@type": "PeopleAudience", "suggestedGender": "unisex", "suggestedAge": { "@type": "QuantitativeValue", "minValue": 13, "unitCode": "ANN" } }, "productGroupID": "44E01", "pattern": "striped", "material": "wool", "variesBy": [ "https://schema.org/size", "https://schema.org/color" ] }, { "@context": "https://schema.org", "@type": "Product", "@id": "#small_green", "isVariantOf": { "@id": "#coat_parent" }, "sku": "44E01-M11000", "gtin14": "98766051104214", "image": "https://www.example.com/coat_green.jpg", "name": "Small green coat", "description": "Small wool green coat for the winter season", "color": "green", "size": "small", "offers": { "@type": "Offer", "url": "https://www.example.com/coat/green?size=small", "priceCurrency": "USD", "price": 39.99, "itemCondition": "https://schema.org/NewCondition", "availability": "https://schema.org/InStock", "shippingDetails": { "@id": "#shipping_policy" }, "hasMerchantReturnPolicy": { "@id": "#return_policy" } } }, { "@context": "https://schema.org", "@type": "Product", "isVariantOf": { "@id": "#coat_parent" }, "url": "https://www.example.com/coat/lightblue?size=small" }, { "@context": "https://schema.org", "@type": "Product", "isVariantOf": { "@id": "#coat_parent" }, "url": "https://www.example.com/coat/lightblue?size=large" }, { "@context": "https://schema.org/", "@type": "OfferShippingDetails", "@id": "#shipping_policy", "shippingRate": { "@type": "MonetaryAmount", "value": "2.99", "currency": "USD" }, "shippingDestination": { "@type": "DefinedRegion", "addressCountry": "US" }, "deliveryTime": { "@type": "ShippingDeliveryTime", "handlingTime": { "@type": "QuantitativeValue", "minValue": 0, "maxValue": 1, "unitCode": "DAY" }, "transitTime": { "@type": "QuantitativeValue", "minValue": 1, "maxValue": 5, "unitCode": "DAY" } } }, { "@context": "https://schema.org/", "@type": "MerchantReturnPolicy", "@id": "#return_policy", "applicableCountry": "US", "returnPolicyCategory": "https://schema.org/MerchantReturnFiniteReturnWindow", "merchantReturnDays": 60, "returnMethod": "https://schema.org/ReturnByMail", "returnFees": "https://schema.org/FreeReturn" } ] </script> </head> <body> </body> </html>
指南規範
為了讓您的產品子類標記可以在 Google 搜尋中使用,請務必遵守下列規範:
技術指南
- 每個子類在對應的結構化資料標記中都必須有專屬 ID (例如使用
sku
或gtin
屬性)。 - 每個產品群組在對應的結構化資料標記中都必須有一個專屬 ID,並以子類
Product
屬性中的inProductGroupWithID
屬性或ProductGroup
屬性中的productGroupID
屬性指定。 - 除了產品子類屬性外,請務必根據商家資訊的必要資源清單 (或產品摘要),加入
Product
結構化資料。 - 如果是單頁網站,所有子類所屬的整體
ProductGroup
都只能有一個不同的標準網址。通常這是基準網址,會指向未預先選取子類的頁面,例如:https://www.example.com/winter_coat
。 - 如果是多頁網站,每個網頁都必須針對該網頁中定義的實體提供完整且獨立的標記 (也就是說,如要完全瞭解網頁本身上的標記,並不需要參照頁面以外的實體)。
- 網站必須能夠透過不同網址 (使用網址查詢參數) 直接預先選取每個子類,例如
https://www.example.com/winter_coat/size=small&color=green
。這樣一來,Google 就能檢索並識別每個子類。預先選取每個子類包含顯示正確的圖片、價格和供應情形,以及讓使用者將子類加入購物車。
結構化資料類型定義
您的結構化資料必須包含必要的屬性,才能在 Google 搜尋中使用這些資料。您也可以加入建議的屬性,為產品子類增添更多相關資訊,提供更優質的使用者體驗。
ProductGroup
Google 可識別 ProductGroup
的下列屬性。schema.org/ProductGroup 內提供 ProductGroup
的完整定義。使用產品子類資訊標記內容時,請使用 ProductGroup
屬性的下列屬性。
必要屬性 | |
---|---|
name |
|
建議屬性 | |
---|---|
aggregateRating |
|
brand |
「 |
brand.name |
|
description |
|
hasVariant |
巢狀 或者,子類 |
productGroupID |
產品群組的 ID (也稱為父項 SKU)。您必須為 |
review |
|
url |
僅適用於單頁網站: |
variesBy |
|
疑難排解
如果無法順利導入結構化資料,或是偵錯時遇到困難,請參考下列資源。
- 如果您使用內容管理系統 (CMS) 或者有他人代您處理網站事務,請向對方尋求協助。請務必將所有與問題相關的 Search Console 訊息都轉寄給對方,這些訊息會針對問題提供詳細說明。
- Google 不保證採用結構化資料的功能一定會顯示在搜尋結果中。如要瞭解為何 Google 無法將您的內容顯示為複合式搜尋結果,請參閱結構化資料通用指南裡的常見原因清單。
- 結構化資料可能含有錯誤。請查看結構化資料錯誤清單。
- 如果您的網頁遭到結構化資料專人介入處理處置,系統會忽略網頁上的結構化資料,但該網頁仍然會出現在 Google 搜尋結果中。請使用專人介入處理報告來修正結構化資料問題。
- 再次查看指南規範,確認您的內容是否符合規定。問題可能是因為垃圾內容或不當使用的標記所引起。不過,因為問題可能與語法無關,所以複合式搜尋結果測試無法找出問題所在。
- 疑難排解:未出現複合式搜尋結果/複合式搜尋結果總數減少。
- 請等待一段時間,讓系統執行重新檢索和重新建立索引作業。在發布網頁後,Google 可能需要幾天時間才會找到網頁並進行檢索。如有關於檢索和索引建立作業的一般問題,請參閱 Google 搜尋檢索和索引常見問題。
- 前往 Google 搜尋中心論壇發文提問。