GA4 Site Search: Analyze Your Site Search Queries
Updated 12/25/24 Google Analytics 4 allows you to track the specific queries searched on your site with the view_search_results enhanced measurement event and the search_term event parameter. This provides useful information for all types of businesses. So whether you have an eCommerce store, a B2B site, or a blog, check out this guide to setting up GA4 site search.
We’ll start by reviewing how you can use the GA4 reports to see your site search terms. Then, well review the 4 steps you can take to ensure you’re properly collecting data.
Table of Contents
- How to See GA4 Search Terms in Reports
- Step 1: Check Enhanced Measurement
- Step 2: Review Your Query Parameter
- Step 3: Update “Advanced Settings” (if needed)
- Step 4: Register a New Custom Dimension
- Wrapping Up
How to See GA4 Search Terms
You can view what search terms your visitors are using to search on your website using the view_search_results event in GA4. This enhanced measurement event is turned on by default when you set up Google Analytics 4. You can read on below to ensure you are tracking this properly.
On its own, this event will count how often site searches take place on your site. While it is helpful to know the total number of searches, you need to use the search_term event parameter to see the specific terms that your visitors are looking for.
Search Term Event Parameter
When building a custom Exploration, add the “Search term” dimension to your report so you can see the individual GA4 search terms. You can see it immediately below by the red arrow.
This adds the search term detail to your report when you filter to only view the view_search_results event and use “event count” as your metric. Like you see in the red box below.
You can also see the search term info in GA4 standard reports if you use a custom dimension to register the search term event parameter. No worries if don’t know what that means. I promise you will before you get to the end of this article.
If you do that, you’ll get this extra card of information when you click into the view_search_results event in your standard event report.
You’ll also have this custom dimension available when you report in Explorations as well. You can see that below by the yellow arrow. This “Site Search Term” custom dimensions holds the exact same information as the “Search term” dimension. So there’s no need to do this unless you want the additional search term info available in the standard reports.
Note: In this situation, I named the custom dimension “Site Search Term.” If you chose something else like “See My Search Terms” when you set up your custom dimension, you’ll see that same name carried through here.
Here’s how to make sure your site is properly tracking the search term data you need.
1.) Confirm Site Search Enhanced Measurement is On
After you’ve installed GA4 and configured your property correctly, hit the gear icon in the bottom left corner of the screen to access the admin section.
Then, click on “Data streams” from either the left-hand navigation or within the Data collection and modification box as shown below.
Click once again to access your data stream for your web site.
Now, you should be able to see the enhanced measurement events you are tracking. Click in to the gear icon as shown below.
By default, all enhanced measurement events will be turned on. If you’ve since gone and changed that, make sure that the site search event has been turned back on.
Note: There are situations where you may want to toggle some of these events off. Scroll depth is a great example of an enhanced measurement event that we can track much more effectively with the help of Google Tag Manager.
You can see the site search enhanced measurement event below. This will cause the view_search_results event to show in your GA4 events.
2.) Review Site Search Query Parameter for Your Site
The enhanced measurement event will work for *most* sites in the default state. Other sites will need to add a search term query parameter to make sure their site search data is being captured in the GA4 data stream.
The best way to find out is to perform a search on your site. Here’s an example of what it looks like when I search for “ga4 bounce rate” on the Root and Branch site. The specific search I looked for is in the red box. Do you see the search query parameters appended to the end of the URL in the blue box at the top of the screen? Check out the first character that follows the question mark after the trailing slash after the hostname. There is an “s” there, which I now know is the default search term query parameter for the site.
As it turns out, this means I don’t need to do any additional configuration with the enhanced measurement event. But unless you have the exact same one, you won’t know that until you go through step 3 below.
3.) Review “advanced settings” of Site Search Event and Update if Needed
Look again at the list of enhanced measurement events that we checked out at the end of step 1. You should see “Show advanced settings” underneath the site search event. Click into it and you’ll see this below.
As long as the search query parameter for your site is included in the list of “Search Term Query Parameter[s]”, you’re in good shape. Congrats!
If not, don’t worry. All you need to do is add your specific query parameter to the list. As you can read below, you can specify up to 10.
You are now tracking the data properly. But without step 4 you won’t be able to see it. Weird, right?
4.) Register the search_term Event Parameter As a Custom Dimension
Registering event parameters as custom dimensions can be a confusing part of GA4. If that previous sentence made no sense to you, consider reading about event parameters here. I
If you don’t do this you’ll be able to see how often a site search took place, but you won’t be able to see what search terms were actually searched when you look in your standard reports.
Note: You will still be able to see the search term event parameter in Explorations whether or not you proceed with this step.
With the “Admin” section, click “Custom definitions” in your Data display settings.
Now, click the blue button on the right to “Create custom dimension.”
How to Create a Custom Dimension for Search Term
Now, we’re going to create this custom dimension.
The “Dimension name” is how this dimension will show up in your reports. I’ve called it “Site Search Term” but you can go nuts if you have a different preference. Make sure the “Scope” is set to “Event”. The description field isn’t necessary, but if you want a reminder for what you’re tracking you can add it here. The event parameter is less flexible and less optional. Set it to search_term as you can see below.
Click “Save“.
You’re now good to go! Congrats! The specific search terms will now flow into your reports. You can see this data in your Engagement standard reports. Or you can use the Explore feature to create an exploration (aka, a custom report within GA4). But the best approach might be create a report in Data Studio that will update automatically for you.
Wrapping Up
Congratulations! You’re now tracking internal site search. You can use that information to help feed your content strategy and get ideas for design changes on your site. For more insight on search terms, you can integrate Search Console with GA4 to see what search terms are bringing visitors to your site.
About Root & Branch
Root & Branch focuses on digital analytics and SEO.
This article was written by Zack Duncan, who is increasingly a data driven weirdo.
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.