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. They 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 for 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.
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.
How to Set Up Site Search in GA4
The first important step whether you are setting site search 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 website, take a look at the URL, noting down the letters or sequences that appear in 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 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 4thoption down – SITE SEARCH – make sure this is turned on and select SHOW ADVANCED SETTINGS
- 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 countbyEvent name’ widget, you should see at least 1 event against the event. name:view_search_result:

To be sure that your search term has come through- click on theview_search_resultsevent and you should see the event parameterkey 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!

Prefer Video? Watch on Youtube
Want to Learn More About GA4?
Are you struggling to set up site search or use GA4 in general? If so, leave a comment below or get in touch with us at contact@glowmetrics.com. You can also stay up-to-date by following GlowMetrics on Twitter, and LinkedIn or by subscribing to our newsletter for the latest tips and news in the world of Digital Analytics and Marketing.
Don’t forget to sign up for a free account on our Resource Hub to access a wealth of valuable resources, including exclusive Digital Analytics and Digital Marketing how-to videos and insights across GA4, SEO, PPC and more.
13 responses to “Setting up Site Search in GA4”
Leave a Reply
Posted 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.
Read more from Joanne KearneyBrowse by Category
- Social Media
- SEM
- SEO
- Google Ads
Digital Marketing
- Google Analytics
- Google Tag Manager
- Google Opimize
Digital Analytics
Optimise your website and marketing campaign performance with Ireland’s leading digital analytics agency
Sign up to our newsletterEnjoyed reading this article? Find more like it below…
Posted by
Hannah Magorrian
Mar 28th 2023
Digital Analytics Insights
2 min read
Alternatives To Google Optimize Post-Sunset
Goodbye Google Optimize! Google has recently announced they will be sunsetting Google Optimize and Optimize 360, effective from 30th September 2023. The announcement cited Google’s desire to provide a better...
Posted by
Nicola Russell
Feb 15th 2019
Digital Analytics Insights
4 min read
It’s Time to Check your Google Analytics for Amazon Bot Spam
UPDATE: As of 4th February 2020, the 'Network Domain' and 'Service Provider' dimensions in Google Analytics have been marked as 'no longer supported' and are returning (not set) values -...
Posted by
Conor Ross
Oct 6th 2020
Digital Analytics Insights
3 min read
Data Studio Showcase: Formula 1 2020
Data visualisation is fast becoming one of the most important aspects of driving a data driven decision making process, supporting the presentation of key statistics and important information in a...
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
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://glowmetrics.com/blog/5-step-guide-to-view-site-search-terms-in-ga4/
Thanks,
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://glowmetrics.com/blog/5-step-guide-to-view-site-search-terms-in-ga4/
Let me know if that works,
Joanne
In UA you can view the search queries by navigating to Acquisition > Google Ads > Keywords or Search Queries. Another path is Campaigns > Paid Keywords.
How does this data get set-up in GA4?
Hi Aimee,
Assuming that you’ve set-up the Site Search Query parameter (search_term) as a custom dimension you’d go to:
Reports > Engagement > Events > view_search_results > Site Search Query (card).
If you want this to be a permanent feature so the report is more easily accessed, edit the LIBRARY then
Create a new report > Pull together the dimension for Site Search Query and the Metric Event Count > Save > Add to report collection.
This table showing site search queries by events (searches) will then appear on the left hand nav as a report that can be easily accessed.
Thanks,
Joanne
I don’t have the event “view_search_terms” in GA4.
Hi Jessica,
Does your site have a search facility on it? Is Site Search turned on under Enhanced Measurement?
Thanks,
Joanne
This is such a useful guide for anyone looking to optimise their site search tracking in GA4
I recently came across another article that builds on this concept by offering an improved method for analysing site searches beyond just search terms and event counts. It focuses on combining additional dimensions and metrics, such as click-through rates and add-to-basket rates, to provide actionable insights into search term performance.
If you’re interested, you can check it out here: https://www.atriaanalytics.co.uk/post/unlocking-the-full-potential-of-ga4-site-search-analysis. It might complement the strategies you’ve shared here.