Back in March, we covered how you can set up site search tracking in Google Analytics 4. Here, we are going to look at how you can expose and view the search terms in regular reporting widgets, not just via real-time reporting. When you set up site search tracking and then perform a search, you’ll see the event come through as a view_search_results event in the ENGAGEMENT > EVENTS report:
…but clicking on this to view further details, will only show you a widget containing the list of terms searched in the last 30 minutes. What if you want to see historical data? As we’ve mentioned before, GA4 takes a bit more customisation work than Universal Analytics to get the data that you want, displayed in the right place.
To do this and expose the site search parameter you’ll need to create the event as a custom dimension first.
Exposing Site Search Terms in GA4
-
Select CONFIGURE from the menu on the left-hand side of any Google Analytics page…then, select CUSTOM DEFINITIONS on the secondary navigation pane:
2. Select CREATE CUSTOM DIMENSION:
3. In the NEW CUSTOM DIMENSION boxes you’ll find fields for:
- Dimension Name: The name that will appear in your search term widget (report table)
- Scope: Specifies to which data the custom dimension or metric will be applied.
- Description (optional): Free text to describe your dimension further
- Event parameter: The event parameter you want to be exposed in reports
While the dimension name and description are free text boxes, scope is predefined. The event parameter might be available to be selected from a pre-defined list- if not, just type ‘search_term’. When tracking site search, the scope should be set to ‘Event’ and the event parameter should be ‘search_term’ as your objective is to pull through the value of the search term parameter.
search_term is the parameter pulled through on the view_search_results event which is triggered when a user searches your content.
4. Once that’s done, go back to REPORTS > ENGAGEMENT > EVENTS. Then, in the table select view_search_results:
5. On the next page, you might see the event name you selected (in the drop-down box) and a widget that corresponds to the custom dimension name you used to create the search_term dimension:
It is there that you will now see a list of the search terms that people have used to search your site! 6. *Update* Create an Exploration if step 5 does not work: We are aware that step 5 might not always work (sometimes it does, sometimes not – that’s the surprise element of GA4!). If you don’t see the widget showing search queries, you can view the same via an exploration report. To do this navigate to EXPLORE and create a new exploration:
Then, follow the same configuration below: VARIABLE CONFIGURATION: Name: Site Search Query (or whichever name you choose for your site search report) Dimensions to import: Search Term and Event Name Metrics to import: Event Count TAB SETTINGS CONFIGURATION: Rows: Search Term Values: Event Count Filters: By Event Name Filter contain: view_search_results You should then see your search terms from there:
Confused by GA4?
If you’re interested in learning more or require support with Google Analytics feel free to leave a comment below or drop us a line at contact@glowmetrics.com. You can also stay up-to-date by following GlowMetrics on Twitter or LinkedIn or by subscribing to our newsletter (see link below) for the latest tips and news in the world of digital analytics and marketing.
Don’t forget to sign up for a complimentary account on our Resource Hub to access a wealth of valuable resources, including exclusive digital analytics and digital marketing how-to videos and insights!
15 responses to “5-Step Guide To View Site Search Terms 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
Conor Ross
Oct 13th 2022
Digital Analytics Insights
3 min read
Introducing Looker Studio
The Artist formerly known as Google Data Studio On October 11th 2022, as part of the Google Cloud Next event, it was announced that reporting and data visualisation tool Google...
Posted by
Nicola Russell
Apr 22nd 2024
Digital Marketing Insights
4 min read
PPC Espionage: How to Spy on Your Competitors’ Ads
In PPC, staying ahead of your competitors requires more than just intuition; it demands strategy, insight, and a little bit of spying. Yes, you read that right - PPC espionage....
Posted by
Conor Ross
Jan 25th 2019
Google Optimize
2 min read
Stop & Edit | Latest Features from Google Optimize
Google Optimize is Google’s tool for user experience testing, complete with Analytics and Ads integration, and Data Studio connectors expected in the future. As well as testing on your site,...
Got as far as step 4 fine. Step 5 – no joy. The widget is not there and there’s no reference to the dimension name I created anywhere.
Hi Nikki,
I’ve just updated the blog article with a step 6- if step 5 still isn’t working for you.
Kind Regards,
Joanne
Hi, When I go to Configure-Custom Dimensions – There’s not an event labelled “search_term” Thanks
Hi Kevin,
Do you mean you can’t see an event parameter for ‘search_term’? If you can’t see it in the list you should be able to type it in manually and that should work.
Kind Regards,
Joanne
Hi Joanne,
I type it in manually, but it’s not working 🙁
When I tried to test it on the website, the ‘search_term’ parameter is showing up at the Event report in the Last 30 Minutes though.
What should i do?
Hi Jasmine,
Can you perform a search on your site, wait at least an hour and then try step 6 above using the Exploration report?
Are the search terms appearing in the exploration report?
If not, can you email me- joanne[at]glowmetrics.com with the website you are trying to track it on and I can look into it further.
Thanks,
Joanne
When I go to Configure-Custom Dimensions – There’s not an event labelled “search_term” and I can’t type.
Hi Melanie,
Have you activated site search tracking? Can you see the event name view_search_results and parameter key search_term?
https://glowmetrics.craftandslice.com/blog/setting-up-site-search-in-ga4/
Can I also just check that you are trying to type in the event parameter field?
Thanks,
Joanne
Joanne:
First, great work. Thanks for all the info.
I got everything to work here but my “Search_Terms_Historical” data still doesn’t appear in a widget under Reports > Engagement > Events > View Search Results. What step am I missing?
Hi Gar,
Have you checked the first blog? Can you see site search terms in real-time widgets?
https://glowmetrics.craftandslice.com/blog/setting-up-site-search-in-ga4/
Thanks,
Joanne
Thank you for make this detailed instruction. I don’t know why GA 4 hidden the search query feature.
Thank you – this really helped me with some GA4 settings.
I’m still a beginner, this tutorial is very helpful for beginners like me. I really appreciate
You guys are talking about “search term” but nowhere written about the “value”! so can you tell me what is the “value” for the “search term”?
Hi Munna, the value or output of the search term parameter is what your user types into your search facility on your website.