Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.dataLayer = window.dataLayer || [];
- window.dataLayer.push({ ecommerce: null });
- window.dataLayer.push({
- event: 'purchase', // name of the event. In this case, it always must be purchase
- ecommerce: {
- currency: 'EUR',
- value: 600.00, // order total (price of all products). If you want, it can be only price of all products
- tax: 45.00, // tax
- shipping: 10.00, // shipping costs
- affiliation: 'Nitro PC', // affiliation (e.g. affiliate id, name of the store, etc.)
- transaction_id: '12384', // transaction id
- coupon: 'pcGaming_10%off', // if coupon was applied to the order, include it here
- items: [{ // an array where all currently viewed products must be included
- item_name: 'Avanzado S Bronze', // insert an actual product name
- item_id: 'SBronze123', // insert an actual product ID
- price: '545.00', // insert an actual product price. Number or a string. Don't include currency code
- item_brand: 'Nitro PC', // insert an actual product brand
- item_category: 'PC Gaming', // insert an actual product top-level category
- item_category2: 'Avanzado S', // if it is possible to drill down the categories (e.g. Apparel, then T-shirt, then Men), use item_category2, item_category3, etc. Can use from item_category up to item_category5
- item_variant: 'Gaming', // insert an actual product variant. (Color, style, etc)
- quantity: '1' // product quantity. In case of view_item_list, it will usually be equal to 1
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement