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:
- Login to your GA4 property and click on the gear icon
- Under PROPERTY navigate to DATA STREAMS and select your WEB STREAM DETAILS
- Click the gear icon under ENHANCED MEASUREMENT
- Under the 4th option down – SITE SEARCH – make sure this is turned on and select SHOW ADVANCED SETTINGS
- 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 ‘Event count by Event name’ 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’). Note- it might take a few minutes for the key and value to appear as you drill down.






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 (not just in the last 30 minutes)?
You’ll be able to see this under your ENGAGEMENT reports under EVENTS under the event: view_search_results
Our follow-up blog demonstrates how to do this: Exposing site search terms in GA4



Happy site search analysing!
Confused by GA4? Check out the Glow Analytics Academy for GA4
Our GA4 Training Course is led by certified GA4 experts who have years of experience working with businesses of all sizes. We’ll teach you everything you need to know about GA4, from setting up your account and tracking your data to creating custom reports and using advanced features.
We’ve developed a schedule of 6 x 3-hour sessions across GTM for GA4, the GA4 Interface, Reports and Insights, and Looker Studio for GA4. By the end of the course, you’ll be able to confidently use GA4 to track and analyze your user data, identify areas for improvement, and make informed decisions to drive business growth.
Interested? We’ll be running courses throughout 2023. Check out our available GA4 Training course dates in Belfast & Dublin.
This doesn’t help. If I click the view_search_results link I can only view terms searched in the last 30 minutes. How do I find the history of all search terms?
I tried to create a report like another blog post suggested (Analysis Hub > Exploration), but I don’t see the search_term option in the list of Dimensions.
Anyone else find GA4 removed all usability and replaced it with less data and more confusion?!
Hi Alex,
To view the search terms retrospectively (not just in real-time) you have to create the event as a custom dimension first under CONFIGURE (on the LHS menu), then Custom definitions > Create custom dimension > under Event parameter > select search_term. This will allow you to then select and use the search_term dimension in reports (Analysis Hub > Exploration).
I’ll do another blog on this (with screenshots) this week but hopefully this helps in the meantime.
Joanne
Hi Joanne, thanks for the article.
I want to make sure. I have created custom dimention for search_term , but it doesnt show any value :(. Is there a delay time for google to collect it ?
Hi Rizki,
Have you/any user searched your site after you’ve created the custom dimension? If not, then perform a site search (making sure you haven’t filtered out your IP), then wait a few hours and set-up an exploration report as detailed in step 6 here: https://www.glowmetrics.com/blog/5-step-guide-to-view-site-search-terms-in-ga4/
Let me know if that works,
Joanne
I also don’t see the dimension “search_term” when creating the report. What’s the issue?
Hi Anthony,
To view the search terms retrospectively (not just in real-time) you have to create the event as a custom dimension first under CONFIGURE (on the LHS menu), then Custom definitions > Create custom dimension > under Event parameter > select search_term. This will allow you to then select and use the search_term dimension in reports (Analysis Hub > Exploration).
I’ll do another blog on this (with screenshots) this week but hopefully this helps in the meantime.
Joanne
I have tried this and while your instructions are very clear, I can’t seem to get it to work. Do you have any suggestions about what else I could try?
Hi Taralee,
Is it that you can’t see any search terms searched in the ‘last 30 minutes’ widget or are you looking for historical data?
If it is the latter, have you followed the 2nd blog to view the site search terms outside the ‘last 30 minutes’ period?
https://www.glowmetrics.com/blog/5-step-guide-to-view-site-search-terms-in-ga4/
Thanks,
Joanne