filipr27

ga4 - slb new - top_nav_click

Sep 8th, 2022 (edited)
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Push this dataLayer event when the user clicks on a link in the top navigation menu of a page.
  2.  
  3. <script>
  4. window.dataLayer = window.dataLayer || [];
  5. window.dataLayer.push({
  6.  'event': 'top_nav_click',
  7.  'click_element': 'sustainability',  //Text or description of the element that was clicked on.
  8.  'menu_name': 'top nav 2',  //Name of the menu that was clicked on.
  9.  'ui_element_name': '<ui_element_name>',  //The name of the UI element from the Zeplin file.
  10.  'ui_element_category': '<ui_element_category>'  //The category of the UI element.
  11.  });
  12. </script>
Advertisement
Add Comment
Please, Sign In to add comment