dusanmiha

Enhanced Ecommerce Checkout 1

May 7th, 2020
89
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 has initiated checkout
  11.             {                  
  12.                 'name': 'TBD (restaurant - meal name ex DUCK & WAFFLE - CORN RIBS)',      // name of a product that is currently viewed
  13.                 'id': 'TBD (ex 123456)',            // id (SKU) of a product (unique for each product for each of the restaurants)
  14.                 'price': '7.00',            // price of a product (The price of one item. The value must not include anything else except number separated by a decimal point. Don't use a comma as the separator, and don't include any currency symbols.)
  15.                 'brand': 'DUCK & WAFFLE',           // brand/vendor of a product
  16.                 'category': 'DUCK & WAFFLE/DUCK & WAFFLE',      // Product category of the item. Can have maximum five levels of hierarchy. restaurant/sub-menu-category (ex. clothes/shirts/t-shirts)
  17.                 'variant': 'TBD',       // product variant. If there are no variants, exclude this key from the dataLayer.push
  18.                 'quantity' : 1              // product quantity
  19.              },
  20.             {  
  21.                 'name': 'TBD (restaurant - meal name ex DUCK & WAFFLE - BACON WRAPPED DATES | Two per order)',      // name of a product that is currently viewed
  22.                 'id': 'TBD (ex 123457)',            // id (SKU) of a product (unique for each product for each of the restaurants)
  23.                 'price': '10.00',           // price of a product (The price of one item. The value must not include anything else except number separated by a decimal point. Don't use a comma as the separator, and don't include any currency symbols.)
  24.                 'brand': 'DUCK & WAFFLE',           // brand/vendor of a product
  25.                 'category': 'DUCK & WAFFLE',        // category of a product within restaurant menu
  26.                 'variant': 'TBD',       // product variant. If there are no variants, exclude this key from the dataLayer.push
  27.                 'quantity' : 2              // product quantity
  28.              },
  29.             {  
  30.                 'name': 'TBD (restaurant - meal name ex DUCK & WAFFLE - CRISPY YELLOWTAIL TAQUITOS | Two per order)',      // name of a product that is currently viewed
  31.                 'id': 'TBD (ex 123458)',            // id (SKU) of a product (unique for each product for each of the restaurants)
  32.                 'price': '15.00',           // price of a product (The value must not include anything else except number separated by a decimal point. Don't use a comma as the separator, and don't include any currency symbols.)
  33.                 'brand': 'DUCK & WAFFLE',           // brand/vendor of a product
  34.                 'category': 'SUSHISAMBA SMALL PLATES',      // Product category of the item. Can have maximum five levels of hierarchy. restaurant/sub-menu-category (ex. clothes/shirts/t-shirts)
  35.                 'variant': 'TBD',       // product variant. If there are no variants, exclude this key from the dataLayer.push
  36.                 'quantity' : 5              // product quantity
  37.              }]
  38.         }
  39.     }
  40. });
  41. </script>
RAW Paste Data