filipr27

ga4 - slb new - sub_category_click

Sep 12th, 2022
179
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 sub-category link. This typically happens on a product category page.
  2.  
  3. <script>
  4. window.dataLayer = window.dataLayer || [];
  5. window.dataLayer.push({
  6.  'event': 'sub_category_click',
  7.  'page_section': 'sub-categories',  //Section of the page where the event happened.
  8.  'sub_category': '<sub_category>',
  9.  'position': '3',  //The element's position in the list, carousel, or card section.
  10.  'strategic_field': '<strategic_field>',
  11.  'topic': '<topic>',
  12.  'category': '<category>',
  13.  'ui_element_name': '<ui_element_name>',  //Name of the UI element from the Zeplin file.
  14.  'ui_element_category': 'card'  //Category of the UI element.
  15.  });
  16. </script>
Advertisement
Add Comment
Please, Sign In to add comment