Page Summary
-
Discounts can be applied to items in an ecommerce event by using the
discountparameter. -
Do not use percentage discounts with the
discountparameter; instead, provide the value of the discount. -
You can report on item-level discounts using the "Item coupon", "Order coupon", and "Item revenue" dimensions and metrics.
-
To report on event-level discounts, you will need to create a custom metric.
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 a percentage
for the discount parameter.
Example
An online store charges $6 per pair of socks. A customer purchases 3 pairs of
socks with a $2 discount per pair. Here's the
purchase
event tag for this example:
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. |
Handle event-level discounts
You can only report discounts at the item level. If you have an event-level
discount, allocate the event-level discount to the items in the event, and in
each item:
- Add the
discountparameter with the allocated unit discount value for the item. - Set the
priceto the unit price minus the allocated unit discount for the item.
You can also create a custom metric to report on event-level discounts.