Apply a discount to an ecommerce event

You can apply a discount to an item in an ecommerce event by adding the discount parameter with the value of the discount. Don't use the percentage discount with the discount parameter.


An online store charges $6 per pair of socks. A customer purchases 3 pairs of socks with a $2 discount per pair. In this example, the purchase event tag would look like the following:

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
    },
]
});

Report on the discount

The following dimensions and metrics allow you to report on discount:

Dimension or metric Description
Item coupon The coupon used to purchase an item (e.g., a product you sell).
Order coupon The coupon name or code that you specify for discounted items.
Item revenue The total revenue from items only, excluding tax and shipping. Item revenue = quantity x price.

If you want to apply event-level discounts, you must create your own custom metric to report on event-level discounts.