SHOW:
|
|
- or go back to the newest paste.
| 1 | - | //Push this dataLayer event when the user clicks to save a content piece on a magazine post page. |
| 1 | + | //Push this dataLayer event when the user performs a site search. The event should fire on the page where the results are displayed. It should fire even if there are no results. |
| 2 | ||
| 3 | <script> | |
| 4 | window.dataLayer = window.dataLayer || []; | |
| 5 | window.dataLayer.push({
| |
| 6 | - | 'event': 'content_save', |
| 6 | + | 'event': 'search', |
| 7 | - | 'page_section': 'enjoyed this article?', //Section of the page where the event happened. |
| 7 | + | 'search_term': 'oil drill', //The term that the user searched for. |
| 8 | - | 'title': 'methane and flare emissions. a fixable problem', //The title of the content piece. |
| 8 | + | 'results_count': '35', //The count of results for a search term or applied filter. |
| 9 | - | 'content_type': 'article', //The type of content. |
| 9 | + | 'website': 'www.slb.com', //The website hostname where the event happened. |
| 10 | - | 'content_category': 'decarbonizing, new energy', //Category that the content piece belongs to. If multiple, separate names by a comma. |
| 10 | + | 'content_group': 'magazine' //The content group that the content piece belongs to. |
| 11 | - | 'content_group': 'magazine', //The content group that the content piece belongs to. |
| 11 | + | |
| 12 | - | 'ui_element_name': '<ui_element_name>', // The name of the UI element from the Zeplin file. |
| 12 | + |