创建商品级范围的自定义参数
您可以通过电子商务事件中的 items
数组来描述您电子商务网站中的产品或服务。Google 提供了必须加入和建议加入 items
数组的参数列表。
除这些参数外,您还可以在 items
数组中加入最多 27 个自定义参数。这些自定义参数被称作商品级范围的自定义参数,可用来获取对业务有用的数据。在这 27 个商品级范围的自定义参数中,您可以配置:
- 10 个商品级范围的自定义维度(对于标准媒体资源)
- 25 个商品级范围的自定义维度(对于 Analytics 360 媒体资源)
在创建商品级范围的自定义参数之前,请务必查看必需参数和建议参数列表。
添加商品级范围的自定义参数
要添加商品级范围的自定义参数,只需将相应参数加入 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 跟踪代码管理器实现。
后续步骤
若要分析商品级范围的自定义参数,必须创建商品级范围的自定义维度。如需了解如何设置商品级范围的自定义维度,请参阅自定义维度和指标。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-13。
[null,null,["最后更新时间 (UTC):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"]]