Skip to content

Ecommerce

Ecommerce Events 2
Search
purchase
/_suY2a
purchase
Popis udalosti
Event is pushed to the dataLayer when user buys a subscription. It should not have been sent after refreshing the thank you page, but only at the moment when the user reached the page after being redirected from the payment gateway. Otherwise, transactions may be duplicated in Google Analytics 4).
Screenshot
Príklad kódu
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "purchase",
ecommerce: {
transaction_id: "T_12345",
value: 5|10|20|xx,
currency: "EUR",
items: [{
item_id: "SKU_12345",
item_name: "card-once-5",
currency: "EUR",
item_brand: "Donation",
item_category: "card|patreon|btc",
item_variant: "once|monthly|patreon|btc",
price: 5,
quantity: 1
}]
},
payment_option: "",
recurrence: true|false,
period: "Once|Monthly|undefined",
payment_method: "CARD|PATREON|BTC",
});
Implementation document
Show hidden columns

Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.