600 x 350 ga4 site search

GA4 Site Search: Analyze Your Site Search Queries

Updated 1/10/24 Google Analytics 4 allows you to track the specific queries searched on your site with the view_search_results enhanced measurement event. 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 5 steps you can take to ensure you’re properly collecting data.

Table of Contents

For the reporting tutorial, you can watch this 4 minute video or simply read on below.

site search reporting in ga4

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.

view search results event

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.

search term event parameter

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.

ga4 search terms

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.

site search term event parameter

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.

select dimensions to see search term

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.

data streams in ga4 admin

Click once again to access your data stream for your web site.

data stream

Now, you should be able to see the enhanced measurement events you are tracking. Click in to the gear icon as shown below.

ga4 enhanced measurement

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.

enhanced measurement ga4 site search

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.

ga4 site search on root and branch

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.

ga4 site search query parameters

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.

custom definitions

Now, click the blue button on the right to “Create custom dimension.”

create new 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“.

search_term custom event parameter

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.

5.) Create Site Search Report in Looker Studio

This step is optional, especially if you have another reporting preference. Otherwise, follow the steps outlined in this video and build the report. There’s a link to a template that you can populate with your own data if you don’t want to start from scratch.

That link is in the description of the video on YouTube and I’ll paste it immediately below as well.

 

Here is that Looker Studio report link. Boom!

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.

And if you’re still someone learning about GA4 (like me), you might check out this Google Analytics beginner’s tutorial or this list of updated GA4 questions. You can also subscribe to the Root and Branch YouTube channel for an updated video every week or so. I’ll see you there!

About Root & Branch

Root & Branch focuses on paid search (PPC), SEO, Local SEO, and Google Analytics. Hit the button below to check out YouTube for more digital marketing tips and training resources.

This article was written by Zack Duncan, who is increasingly a data driven weirdo.

click to yt

8 replies

Trackbacks & Pingbacks

  1. […] A session is another name for a visit to a website. An event in GA4 is a specific interaction that takes place during the session. There can be (and usually are) multiple events that take during a single session. Some other examples of events are viewed pages (page_view event), scroll activity (scroll event), and file downloads (file_download event), and site search (view_search_results). […]

  2. […] This guide has all you need about site search tracking. […]

  3. […] This guide has all you need about site search tracking. […]

  4. […] of searches, you’re talking once again about those pesky event parameters. This guide to GA4 site search will show you to build a quick report and get useful insights about what your visitors are looking […]

  5. […] of searches, you’re talking once again about those pesky event parameters. This guide to GA4 site search will show you to build a quick report and get useful insights about what your visitors are looking […]

  6. […] Build a Site Search report with Data Studio to see what your visitors are looking for on your site […]

  7. […] searched. If you’re interested in that specific case, you may want to review this guide to GA4 site search tracking, including how to build a Data Studio report to see your search […]

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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