Skip to content

Instantly share code, notes, and snippets.

@kmclaugh
Created August 23, 2021 14:58
Show Gist options
  • Save kmclaugh/94306c26e24496abea8c9ac996f6cded to your computer and use it in GitHub Desktop.
Save kmclaugh/94306c26e24496abea8c9ac996f6cded to your computer and use it in GitHub Desktop.
Wrapmate Purchases
/*
* action: purchase
* description: fire when the user actually completes the expressway purchase
*/
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: "eec.purchase",
customerId: "{{customerId}}", // the customer id if available at purchase
eecEventName: "Purchase",
ecommerce: {
currencyCode: "USD",
purchase: {
actionField: {
id: "{{checkout.order_number}}", // 12345 // The order number or transaction id
affiliation: "Wrapmate",
revenue:
'{{amount}}', // 11.00 // the total transaction value
tax: '{{tax}}', // 1.0 // the tax paid
coupon: "{{discount.code}}", // SUMMER2020 // any discount code used
},
products: [],
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment