filipr27

ga4 - slb new - search

Sep 12th, 2022 (edited)
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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': 'search',
  7.  'search_term': 'oil drill',  //The term that the user searched for.
  8.  'results_count': '35',  //The count of results for a search term or applied filter.
  9.  'website': 'www.slb.com',  //The website hostname where the event happened.
  10.  'content_group': 'magazine'  //The content group that the content piece belongs to.
  11.  });
  12. </script>
Advertisement
Add Comment
Please, Sign In to add comment