Anda dapat menerapkan diskon ke item dalam peristiwa e-commerce dengan menambahkan parameter discount bersama nilai diskon. Jangan gunakan persentase
diskon dengan parameter discount.
Contoh
Sebuah toko online mengenakan biaya $6 untuk sepasang kaus kaki. Pelanggan membeli 3 pasang kaus kaki dengan diskon $2 untuk sepasang kaus kaki. Dalam contoh ini, tag peristiwa purchase akan terlihat seperti berikut:
[null,null,["Terakhir diperbarui pada 2024-09-13 UTC."],[[["Use the `discount` parameter to apply discounts to items in ecommerce events, representing the total discount amount, not the percentage."],["The example demonstrates applying a per-item discount during a purchase event using the `discount` parameter in gtag.js."],["Reporting on discounts is possible using dimensions like `item_coupon`, `order_coupon`, and metrics like `item_revenue`."],["For event-level discounts, create a custom metric to track and report them separately."]]],["To apply a discount to an item in an ecommerce event, add the `discount` parameter, using the discount value, not a percentage. For instance, if a customer buys three pairs of socks at $6 each with a $2 discount per pair, the `purchase` event tag reflects this. Reports can use \"Item coupon,\" \"Order coupon,\" and \"Item revenue\" to track these discounts. For event-level discounts, custom metrics are needed.\n"]]