dusanmiha

header interactions

Jun 2nd, 2022 (edited)
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Fire this dataLayer event when a user interacts with header elements. Note that we are not allowed to send emails or any other PII to Google Analytics.
  2.  
  3. <script>
  4. window.dataLayer = window.dataLayer || [];
  5. window.dataLayer.push({
  6.  'event': 'headerInteraction',
  7.  'dropdownCategory': 'Products, Sellers or Profile',  // Variable value based on user's selection. Send this parameter with dropdown clicks Header clicks only. Value of parameter should be dropdown label (ex Products, Sellers, Profile).
  8.  'elementText': 'Logo, Home, Products, Completions, Drilling, Geoscience, Shop all products, Sellers, See all sellers, Cameron, profile, orders, Saved carts, Cart, Sign in, Register, Open Menu, Close Menu etc..'  //  Variable value based on the click text or visitors interaction.
  9.  });
  10. </script>
Add Comment
Please, Sign In to add comment