对电子商务事件应用折扣

您可以通过添加 discount 参数并设定折扣值,对电子商务事件中的商品应用折扣。请勿为 discount 参数使用百分比。


示例

一家网店每双袜子卖 $6。客户购买了 3 双袜子,每双优惠 $2。以下是此示例的 purchase 事件代码:

gtag("event", "purchase", {
    transaction_id: "T_12345",
    coupon: "socksSale",
    value: 12.00, // value = quantity x sale price
    currency: "USD", // The currency of the value, discount, and price
    items: [
     {
      item_id: "SKU_12345",
      item_name: "Socks",
      discount: 2.00, // The discount per item
      price: 4.00, // The sale price is the per item list price (6.00) minus discount (2.00)
      quantity: 3 // The number of items sold
    },
]
});

报告折扣

通过以下维度和指标,您可以报告折扣:

维度或指标 说明
商品优惠券 用于购买商品(例如您销售的产品)的优惠券。
订单优惠券 您为折扣商品指定的优惠券名称或代码。
商品收入 仅商品带来的总收入(不含税费和运费)。商品收入 = quantity x price

处理活动级折扣

您只能在商品级报告折扣。如果您有活动级折扣,请将活动级折扣分配给活动中的 items,并在每个商品中执行以下操作:

  1. 添加 discount 参数,并为相应商品分配单位折扣值。
  2. price 设置为单价减去商品的分配单位折扣。

您还可以创建自定义指标来报告事件级折扣。