Skip to main content

Hi Gainsight Community 👋,

In this article you’ll learn how to add search results from CC to your GA4 set up using our 10 step guide. Through the GA4 site search tracking feature, you can determine the search terms that are being entered into your CC search bar. 

  1. To begin, Navigate and click on ‘Admin’ on the left hand side navigation bar:

 

  1. Next, click ‘Data Steams’ under the ‘Data collection and modification’ column:

     

  1. Click on the Data Stream you want to set up site search tracking with in GA4 (your CC) and then ensure that the ‘Enhanced Measurement’ feature is enabled:
     
  2. Click the cog under Enhanced Measurement and ensure that Site search is turned on. Then click on ‘Show advanced settings’ and ensure that the Search Term Query Parameter includes ‘q’:
     
  3. Click on ‘Save’  in the overlay to save the advanced site search settings:
     
  4. Next, click on ‘Custom definitions’ under the ‘Property’ column in the Admin area:
     

     

  5. Click on ‘Create custom dimensions’ and fill out the Dimension name and Event parameter with ‘search_term’:
     

     

  6. Once you have set up site search tracking, wait for at least 24 hours before you look for this search term data in your GA4 property. Then navigate to ‘Reports’ → ‘Examine user behaviour’ → ‘Events’:
     

     

  7. Then click on the event name ‘view_search_results’.
     

     

  8. Finally, scroll down the report until you can see the data card called ‘search_term’.
     

 

Et voilà! That’s how you are able to see what your users are searching within the Community.

Hello @olimarrio 

Thanks for the great tutorial. I have couple of follow up question., that might be silly but I am not that familiar with GA4 yet. 

We would like to track number of document downloads from various articles that we post. Should I create custom dimension per article? File_download just gives generic info.

Would you be able to assist? Thank you in advance.


Hey @Grzegorz Byrski 👋,

I’m no expert with GA4 but it looks like you are able to drill down into file downloads more by creating a custom report. Check out the following resources:

https://www.analyticsmania.com/post/track-file-downloads-with-google-analytics-4/#explorations

 

Hope these help!


Any suggestion on how we could track the filters applied in the search and how many search results that search term had? 


Hi ​@Fillipe 👋,

Filters that are applied on the search results page are added to the URL so I’m wondering if you can simply track the URLs here?

There’s no out of the box way that GA4 can see how many search results each search term finds. The only methods I can think of is to create a custom dimension that captures either:

  1. The number of results from an element in the DOM (i.e. the number shown on the results page).
  2. The nbHits as defined by the search engine, Algolia, in the network tab. This would be more consistent but would need to be hacked together with JavaScript by intercepting the network response.

Reply