dusanmiha

VIP - EEC - Checkout Step 1

Dec 2nd, 2020 (edited)
79
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.checkout',                // name of an event. In this case, always stays as eec.checkout
  5.     'ecommerce': {                          // ecommerce object. This is the essential part of tracking. New EE data must always be pushed to this object
  6.         'checkout': {                       // name of an action. In this case, always stays as checkout
  7.             'actionField': {   
  8.                 'step': 1                   // number of the checkout step that a user has entered (must always be 1 in this situation)
  9.             },
  10.             'products': [{                  // list of products a user had in a cart before entering the checkout
  11.                 'name': '{{Product Name 1}}',      // name of a product that is currently viewed
  12.                 'id': '{{Product ID 1}}',           // id of a product
  13.                 'price': '{{Product Price 1}}',         // price of a product 330.00
  14.                 'brand': '{{Product Brand 1}}',         // brand/vendor of a product
  15.                 'category': '{{Product Category 1}}',       // category of a product
  16.                 'variant': '{{Product Variant 1}}',         // product variant. If there are no variants, exclude this key from the dataLayer.push
  17.                 'quantity': {{Product Quantity 1}}     // product quantity
  18.                 'dimension20': '{{tariff}}', //optional. A Product-scoped Custom Dimension for index number N. If there are no variants, exclude this key from the dataLayer.push
  19.             },
  20.                 'name': '{{Product Name 2}}',      // name of a product that is currently viewed
  21.                 'id': '{{Product ID 2}}',           // id of a product
  22.                 'price': '{{Product Price 2}}',         // price of a product 330.00
  23.                 'brand': '{{Product Brand 2}}',         // brand/vendor of a product
  24.                 'category': '{{Product Category 2}}',       // category of a product
  25.                 'variant': '{{Product Variant 2}}',         // product variant. If there are no variants, exclude this key from the dataLayer.push
  26.                 'quantity': {{Product Quantity 2}}    // product quantity
  27.                 'dimension20': '{{tariff}}', //optional. A Product-scoped Custom Dimension for index number N. If there are no variants, exclude this key from the dataLayer.push
  28.             }]
  29.         }
  30.     }
  31. });
  32. </script>
RAW Paste Data