Advertisement
jaspacio

GA UA Checkout: Step 1

Oct 28th, 2020 (edited)
165
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': 'checkout',                // name of an event. In this case, always stays as 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': 'Citizen - SUPER TITANIUM. MODEL: AW0060-11P',      // name of a product that is currently viewed
  12.                 'id': 'CIT30283',           // id of a product
  13.                 'price': '330.00',          // price of a product
  14.                 'brand': 'Citizen',         // brand/vendor of a product
  15.                 'category': 'Watches',      // category of a product
  16.                 'variant': 'Silver',        // product variant. If there are no variants, exclude this key from the dataLayer.push
  17.                 'quantity': 1
  18.             }]
  19.         }
  20.     }
  21. });
  22. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement