建立以商品為範圍的自訂參數
電子商務中的 items
陣列
事件可讓您描述電子商務網站上的產品或服務。
Google 提供了必要和建議的參數清單
加入 items
陣列中
除了這些參數,您最多可在
items
陣列。這些自訂參數稱為「以商品為範圍的自訂參數」
參數,以便擷取對
的商機。在這 27 個自訂參數參數中,您可以設定:
- 標準資源可設定 10 個以商品為範圍的自訂維度
- Analytics 360 資源可設定 25 個以商品為範圍的自訂維度
請務必先查看必要和建議參數的清單,
自行建立以商品為範圍的自訂參數
新增以商品為範圍的自訂參數
如要新增以商品為範圍的自訂參數,請在
items
陣列。舉例來說,如要記錄產品是否有現貨
在事件中加入下列 in_stock
自訂參數:
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
discount: 2.22,
index: 0,
item_brand: "Google",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_category4: "Crew",
item_category5: "Short sleeve",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
in_stock: true, // The item-scoped custom parameter "in_stock"
location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",
price: 10.01,
quantity: 3
}
]
請注意,這些步驟同時適用於 gtag.js 和 Google 代碼管理工具
。
後續步驟
如要分析以商品為範圍的自訂參數,請建立以商品為範圍的自訂自訂參數
維度。如要瞭解如何設定以商品為範圍的自訂維度
請參閱「自訂維度和指標」一文。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-13 (世界標準時間)。
[null,null,["上次更新時間:2024-09-13 (世界標準時間)。"],[[["The `items` array in ecommerce events describes products or services, using parameters defined by Google."],["You can add up to 27 custom item-scoped parameters to the `items` array to capture business-specific data."],["Custom item-scoped parameters can be added directly to the `items` array within your ecommerce events, like the example showing the `in_stock` parameter."],["To analyze item-scoped custom parameters in your reports, you need to create corresponding item-scoped custom dimensions in Google Analytics."]]],["The `items` array in ecommerce events allows for product/service descriptions, including required and recommended parameters. You can also add up to 27 custom item-scoped parameters, like `in_stock`, within this array. For standard properties, 10 item-scoped custom dimensions are configurable, and 25 for Analytics 360 properties. Adding a custom parameter involves including it in the `items` array. To analyze these parameters, an item-scoped custom dimension needs to be created.\n"]]