View difference between Paste ID: 3iSmcJhY and FYiVrisa
SHOW: | | - or go back to the newest paste.
1-
//Push this dataLayer event when the user clicks on a link in the helpful links section on a page. (Don't push this event for the links in the footer.)
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': 'helpful_links_click',
6+
 'event': 'top_nav_click',
7-
 'click_element': 'magazine',  //Text or description of the element that was clicked on.
7+
 'click_element': 'sustainability',  //Text or description of the element that was clicked on.
8-
 'position': '2',  //The element's position in the list, carousel, or card section.
8+
 'menu_name': 'top nav 2',  //Name of the menu that was clicked on.
9-
 'ui_element_name': 'helpful links',  //The name of the UI element from the Zeplin file.
9+
 'ui_element_name': '<ui_element_name>',  //The name of the UI element from the Zeplin file.
10-
 'ui_element_category': 'link'  //The category of the UI element.
10+
 'ui_element_category': '<ui_element_category>'  //The category of the UI element.
11
 });
12
</script>