Setting up Site Search in GA4

Written by Joanne Kearney

Joanne has over 10 years’ experience working in digital analytics, executing and managing many large scale projects across the UK and Ireland. Joanne is also an experienced trainer, having developed many customised corporate training schemes and regularly speaks at digital and analytics events.
March 19, 2021

When talking about site search reporting in Google Analytics I always refer back to the client we had years ago that had over 5 years of site search data but didn’t realise it was being collected. To their surprise they didn’t sell their top searched item but it was a product that was closely related to what they offer. The researched it further and found they could source it, ship it in and start selling it and have made lots of revenue on it since then.

Knowing what people are searching when they get to your site is important- visitors that search are normally searching for something that they can’t find on the site and this is generally content or products that you either do or don’t have.

Whether it helps you expand your product range, add additional buttons or content to your site, or rename part of your navigation menu to better help people find what they need- site search is one of the less talked about reports in Google Analytics but one that can easily provide you with quick-win actionable insights.

Still using Universal Analytics and want to view how to set-up site search? You can follow the instructions on an older blog post here Top Tips And Tricks To Using Google Analytics Better.

In this blog we are going to focus on how to set this up for GA4.


The first important step whether you are setting site search up for Universal Analytics or GA4 is identifying what your search query parameter is. 

Not sure what your site search query parameter is? To get the query parameter perform a search on your own website, take a look at the URL, note down the letters or sequence that appears just before the search term or terms. Then perform another search and check the URL again to see if the same letters or sequence appears again before your search term. If it does and this is a common pattern, then you can take this as your search query parameter.

For example, in the case of GlowMetrics, when you perform a search on our website you will see a s before the search term each time so this is our query parameter that Google Analytics can now use to identify that a search has been performed:

Next:

  1. Login to your GA4 property and click on the gear icon
  2. Under PROPERTY navigate to DATA STREAMS and select your WEB STREAM DETAILS
  3. Click the gear icon under ENHANCED MEASUREMENT
  4. Under the 4th option down – SITE SEARCH – make sure this is turned on and select SHOW ADVANCED SETTINGS
  5. In here, add your SEARCH TERM QUERY PARAMETER and click SAVE.

The first 30 seconds of the video will demonstrate this:

You’ll want to check that this is working when you’ve set it up so go back to your site and perform a search. Then, go back to your real-time reports and under the ‘What are your top events’ widget, you should see at least 1 event against event name: view_search_result:

To be sure that your search term has come through- click on the view_search_results event and you should see the event parameter key search_term, clicking on this, you should see the value (your search term- in this case, I searched for ‘site search’):

If you can’t see your search/search keyword- make sure you aren’t filtering out your IP!

Want to check your site search data going forward?

You’ll be able to see this under your ENGAGEMENT reports under EVENTS under the event: view_search_results

Happy site search analysing!

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Enjoyed reading this article? Find more like it below…