試用 Google Analytics 的 MCP 伺服器。從
GitHub 安裝,詳情請參閱
公告。
建立以商品為範圍的自訂參數
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
電子商務中的 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 (世界標準時間)。"],[[["\u003cp\u003eThe \u003ccode\u003eitems\u003c/code\u003e array in ecommerce events describes products or services, using parameters defined by Google.\u003c/p\u003e\n"],["\u003cp\u003eYou can add up to 27 custom item-scoped parameters to the \u003ccode\u003eitems\u003c/code\u003e array to capture business-specific data.\u003c/p\u003e\n"],["\u003cp\u003eCustom item-scoped parameters can be added directly to the \u003ccode\u003eitems\u003c/code\u003e array within your ecommerce events, like the example showing the \u003ccode\u003ein_stock\u003c/code\u003e parameter.\u003c/p\u003e\n"],["\u003cp\u003eTo analyze item-scoped custom parameters in your reports, you need to create corresponding item-scoped custom dimensions in Google Analytics.\u003c/p\u003e\n"]]],["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"],null,["# Create item-scoped custom parameters\n\nThe [`items` array](/analytics/devguides/collection/ga4/ecommerce#implementation) in ecommerce\nevents lets you describe the products or services on your ecommerce website.\nGoogle provides a [list of required and recommended parameters](/analytics/devguides/collection/ga4/reference/events)\nto include in the `items` array.\n\nIn addition to these parameters, you can include up to 27 custom parameters in\nthe `items` array. These custom parameters are called **custom item-scoped\nparameters** and they let you capture data that's useful to your\nbusiness. Of these 27 custom item parameters, you can configure:\n\n- 10 item-scoped custom dimensions for standard properties\n- 25 item-scoped custom dimensions for Analytics 360 properties\n\nMake sure to review the list of required and recommended parameters before\ncreating your own item-scoped custom parameters.\n\nAdd an item-scoped custom parameter\n-----------------------------------\n\nTo add an item-scoped custom parameter, include the parameter in the\n`items` array. For example, to capture whether a product is in stock, you can\nadd the following `in_stock` custom parameter to the event: \n\n items: [\n {\n item_id: \"SKU_12345\",\n item_name: \"Stan and Friends Tee\",\n affiliation: \"Google Merchandise Store\",\n coupon: \"SUMMER_FUN\",\n discount: 2.22,\n index: 0,\n item_brand: \"Google\",\n item_category: \"Apparel\",\n item_category2: \"Adult\",\n item_category3: \"Shirts\",\n item_category4: \"Crew\",\n item_category5: \"Short sleeve\",\n item_list_id: \"related_products\",\n item_list_name: \"Related Products\",\n item_variant: \"green\",\n in_stock: true, // The item-scoped custom parameter \"in_stock\"\n location_id: \"ChIJIQBpAG2ahYAR_6128GcTUEo\",\n price: 10.01,\n quantity: 3\n }\n ]\n\nNote that these steps apply to both gtag.js and Google Tag Manager\nimplementations.\n\nNext steps\n----------\n\nTo analyze item-scoped custom parameters, you must create an item-scoped custom\ndimension. For information about how to set up the item-scoped custom dimension,\nsee [Custom dimensions and metrics](//support.google.com/analytics/answer/10075209)."]]