carlosmdh

eec.purchase

May 26th, 2022 (edited)
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. window.dataLayer  = window.dataLayer || [];
  3. window.dataLayer.push({
  4.     'event': 'eec.purchase',                // name of an event. In this case, always stays as eec.purchase
  5.     'ecommerce': {                          // ecommerce object. This is the essential part of tracking. New EE data must always be pushed to this object
  6.         'purchase': {                       // name of an action. In this case, always stays as purchase
  7.             'actionField': {
  8.                 'id': '155',                // order id. required
  9.                 'affiliation': 'affiliate', // name of the affiliate. or affiliate id
  10.                 'revenue': '49.00',         // order revenue without taxes
  11.                 'tax':'4.90',               // taxes (excluding shipping)
  12.                 'shipping': '0.00',     // shipping cost
  13.                 'coupon': 'SUMMER20'        // coupon code used in this transaction
  14.             },
  15.             'products': [{                  // list of products a user has purchased
  16.             'name': 'The Yellow Bus',       // name of a product that is displayed. Always include it.
  17.             'id': 'TYB001',                 // id of a product. Always include it.
  18.             'price': '14.00',               // price of a product
  19.             'brand': 'The Yellow Bus',      // brand/vendor of a product
  20.             'category': 'Madrid',           // category of a product
  21.             'variant': 'Adulto',            // product variant. If there are no variants, exclude this key from the dataLayer.push
  22.                 'quantity' : 1              // product quantity
  23.              },
  24.          {
  25.             'name': 'Flamenco Show Torres Bermejas',        // name of a product that is displayed. Always include it.
  26.             'id': 'FTB0001',                                // id of a product. Always include it.
  27.             'price': '35.00',                               // price of a product
  28.             'brand': 'The Yellow Tours',                    // brand/vendor of a product
  29.             'category': 'Madrid',                           // category of a product                            
  30.             'variant': 'Adultos',                           // product variant. If there are no variants, exclude this key from the dataLayer.push
  31.         }] 
  32.   }
  33. }
  34. });
  35. </script>
Advertisement
Add Comment
Please, Sign In to add comment