Google Analytics 4 Site Search Report (GA4)

Google Analytics 4

The Google Analytics 4 site search report can help you track what users are trying to find on your website.

This information can be found in the view_search_results event in GA4. This is an enhanced measurement event, which means it’s already set up for you upon launch. (So long as you don’t turn it off.)

If your Google Analytics site search settings are properly configured, too, then you’re ready to get started.


Content

1. Google Analytics 4 Site Search Event

2. GA4 view_search_results Parameters

3. GA4 Report: Track Site Searches

  • Site Search Report in Reports
  • Site Search Report in Explore

4. What are the benefits of having site search on my website?

5. Why aren’t I getting more searches on my site?


Google Analytics 4 Site Search Event

The official GA4 event for site search is view_search_results.

This is activated by default in your enhanced measurement events.

GA4 enhanced measurement event settings

As you can see, there are some advanced settings for site search. This is where you ensure that Google is capturing your site search query and additional query parameters from your results-page URL.


GA4 view_search_results Parameters

The search_term parameter is included in the view_search_results event by default.

You can add additional parameters with additional query parameters in the advanced settings of your Site search event. (See previous screenshot.)

This will allow you to see data concerning the view_search_results event, the search_term parameter and any other custom parameters you add.


GA4 Report: Track Site Searches

There are two ways to look at a site search report in Google Analytics 4: In the Reports tab and in the Explore section.

Site Search Report in Reports

In your Google Analytics 4 dashboard, click on reports on the left sidebar.

Then click Engagement under the Life cycle menu. From there, click on Events.

When you scroll down, this will show the 10 most popular events based on how many times they have been triggered.

Scroll down to view_search_results. If you don’t see it in the first 10, you can either add more rows to the report by changing the number in the dropdown next to “Rows per page,” or you can type “view_search_results” into the “Search…” bar at the top-left portion of the table. (Not the main GA4 search bar you see in the following screenshot.)

Google Analytics 4 Report view_search_results

This will tell you (from left to right) how many times the view_search_results event has been triggered, the total number of users who triggered it, how many times per user the event was triggered and the total revenue generated by this event.

All these numbers will be based on the time frame you have selected for the report.

You can change this at the top-right portion of your dashboard screen. The numbers should then change as well.

Now click the “view_search_results” event in the table. You will be taken to another page with data limited to that event.

Google Analytics 4 view_search_results event page in Reports

Scroll down slightly and you’ll see a widget that allows you to look at data for parameters associated with this event. When you click the dropdown, you should see a “search_term” option.

This will show you exactly what people searched for on your site. But there’s a catch: this only shows data for the last 30 minutes.

Google Analytics 4 view_search_results event page with search_term parameter in Reports

What if you want to see the search terms used on your site for the entire date range you selected?

The best way to do that is in the Explore section.

Site Search Report in Explore

Here’s how to see the exact search terms users are using within your site. (Not to be confused with the keywords people use to reach your site from search engines like Google.)

Click the Explore tab on the left sidebar menu in your GA4 dashboard.

Start a new “Blank” exploration by clicking the “Blank” option.

Google Analytics 4 Explore New Blank Exploration

Now follow these steps:

1. In the Variables column, select your desired date range

2. Click the + sign next to DIMENSIONS

3. Search for “Event name” (found under “Event”), check the box next to it

4. Search for “Search term” (found under “General”), check the box next to it and click “Import”

5. Click the + sign next to DIMENSIONS

6. Search for “Event count” (found under “Event”), check the box next to it and click “Import”

7. Double-click “Event name,” “Search term” and “Event count”

These should now have populated the Tab Settings column. So long as there have been site searches within your selected date range, you should see data on the right.

Tip: Instead of double-clicking dimensions and metrics from the left, you can also drag them. In this case, double-clicking is fine because by default, the DIMENSIONS go into the ROWS section and the METRICS go into the VALUES section.

The DIMENSIONS can also go into the COLUMNS section, but we’re not going to do that for this report.

One more thing: The order in which the dimensions are placed (from top to bottom) in the ROWS or COLUMNS section is the order in which they will appear (from left to right) in the data visualization window.

Also see:
Creating Custom Dimensions in GA4
GA4 Custom Dimensions Limit

8. Scroll to the bottom of the Tab Settings column and click the box below where it says “FILTERS.” Now select “Event name.”

9. Then choose the “exactly matches” filter and select “view_search_results” as the event name.

Google Analytics 4 Tab Settings Filters Event Name

10. If you have a high volume of searches on your site, change the number in the “Show rows” number in the dropdown menu to as high as 500.

Your dashboard should now look something like this:


Google Analytics 4 Explore report view_search_results and search_term

Not big enough? To see your data in an even larger window, minimize the Variables and Tab Settings columns by clicking the small horizontal lines highlighted in the previous screenshot.

Google Analytics 4 Explore report view_search_results and search_term enlarged

What are the benefits of having site search on my website?

The Google Analytics 4 site search report can tell you a lot about what user’s want to see from you.

Here are some benefits of having site search on your website:

1. Easier for users to find content

Depending on how your site is structured, it may be easier for someone to find content by searching than by navigating.

2. Reinforces existing content topics

If people are searching for things that are already on your website, that’s confirmation that you’re providing information on relevant topics.

3. Gives you new content ideas

If people are searching for things that are NOT on your website, these could be hints as to what topics you should create content for next.

For example, let’s say you have a flowers website. Imagine that your “roses” content performs well.

While checking the report you just set up, you notice that people frequently search your site for content related to “tulips.” The problem? You don’t have any content about tulips.

If the volume is high enough, this could be a hint to start creating some high-quality tulips content.


Why aren’t I getting more searches on my site?

If you’re not getting a lot of searches on your site, here are two possible explanations:

1. Your website doesn’t actually have a search bar

If this is the case, check within your CMS to see if it’s possible to add one. You can also ask one of your site developers about adding one.

2. Your site search bar may be hidden

Most site search bars are in the page’s header, so that’s probably where most users would expect to find it.

Here’s what the search bar looks like on Amazon:

Amazon search bar example

If your site search bar is located somewhere else, your users may be less likely to utilize it.

Site Search Settings Google Analytics 4 (GA4)

Google Analytics 4

Google Analytics 4 Site search settings are configured in your Data Streams.

Even though view_search_results is an enhanced measurement event, it’s worth making sure yours is properly configured.

Here’s how to check the GA4 settings for tracking searches on your site.


Content

1. Google Analytics 4 Site Search Settings

2. GA4 Site Search Advanced Settings


Google Analytics 4 Site Search Settings

To check on your site search settings, find your GA4 Data Streams in the property column of the Admin section of your account.

Click on your Web data stream. It should have a globe-looking symbol next to it.

Google Analytics 4 Web Data Stream

Hopefully the popup indicates that your enhanced measurement events are being activated. If so, you’ll see a white checkmark inside a blue circle switched to the right.

Google Analytics 4 Enhanced Measurement Events Settings

Now click on the settings cog on the bottom right. As you can see, Site search is included in the enhanced measurement events.

Google Analytics 4 Enhanced Measurement Events Details

If the check mark across from Site search is to the right and encircled in blue, you should be good to go.

But let’s not take anything for granted. To make sure Google Analytics 4 is accurately collecting our site search data, we need to look at the advanced settings.

Also see: Google Analytics 4 Site Search Report


GA4 Site Search Advanced Settings

Just like events have parameters, so do search queries. Parameters are additional bits of information that tell us more about the search.

There are two types of broad categories for parameters in the Site search (view_search_results) event: search term query parameter and additional query parameters.

Let’s look at both.

Search Term Query Parameter

Picking up where we left off above, in the enhanced measurement events screen, click on “Show advanced settings” in the Site search row.

If you haven’t previously changed anything in your dashboard, you should now see this:

Google Analytics 4 Site Search Advanced Settings

In most cases, you won’t have to change anything for your Site search event to collect data in your dashboard. Here’s how to do a test to be sure.

Search for something – anything – on your website (or mine). Now look at the backend of the URL.

Google Analytics 4 site search test on bradgerick_com

In this search on my site, I entered “custom dimensions” in the search bar. (You can find the search bar it in the footer of the site if you want to test for yourself.)

The URL structure for searches on my site is bradgerick.com/?s=[search+term]. You can see this at the very top of the previous screenshot.

Looking at one more example, the New York Times URL structure for searches is: https://www.nytimes.com/search?query=%5Bsearch+term%5D.

In the Google Analytics 4 site search advanced settings, we see that there are five possible search term query parameters: q,s,search,query,keyword.

We also see that “Only the first matching parameter will be used.”

In the case of URLs for searches on my site, there’s only one parameter, and it’s “s”. That means Google should capture the data.

Same for the Times, which uses “query.”

If I use DebugView while performing a search on bradgerick.com, I can confirm that the search_term parameter is “custom dimensions” – the same term for which I searched – within the view_search_results event.

Google Analytics 4 view_search_results event search_term parameter

This means that the way the site search event is set up by default captures everything I need for my site.

There is no need to make any changes.

What if my site search parameter isn’t included by default in GA4?

If you perform a search on your site, and you see a different parameter in the URL for some reason, you should tell Google what this is in your advanced settings.

For example, imagine that the URL parameter for searches on my site was abcxyz like in this screenshot where I deliberately changed the URL:

Google Analytics 4 site search URL with custom parameter

If this really were the search parameter for my site, I would need to change my Search Term Query Parameter to abcxyz.

Just like above, to do this I would go to Admin > Data Streams > Enhanced Measurement Settings > Site search event advanced settings.

Then I would replace q,s,search,query,keyword with abcxyz. It would look like this:

Google Analytics 4 site search event advanced settings custom query parameter

After saving the setting, this would begin to collect site search data.


Site Search Additional Query Parameters GA4

The second field in GA4 site search advanced settings is for additional query parameters. As you can see, you’re allowed to have up to 10.

But what is an additional query parameter for a website search?

If I search for shoes on Zara and I click the men’s section, this is what the URL looks like.

Google Analytics 4 search parameter query example zara website

The highlighted portion at the end is an additional search parameter: section=MAN.

This means that they would want to put “section” in the second field of advanced search settings.

But is Zara ready to go now? Take one more look at the link. Did you notice the part in yellow?

Their site’s search parameter query is searchTerm, which is not included by default in GA4.

So just like we changed it to abcxyz in my made-up example above, Zara would have to change their GA4 site search query parameter setting.

Along with the additional query parameter change, this is what Zara’s advanced Site search settings should look like:

Google Analytics 4 additional parameter query example zara website

Remember, you can have up to 10 additional query parameters, so be sure to include them all. Also note that additional query parameters in Google Analytics 4 a case-sensitive.

Seeing Site Search Parameters in GA4 Reports

Any Google Analytics 4 event custom parameter you want to see in your data must first be created as a custom dimension.

By default, search_term is included as a view_search_results parameter, so you do not need a custom dimension.

Any additional search query parameters, however, do need a custom dimension.

Also see:
Google Analytics 4 Custom Dimensions Limit
Delete Custom Dimension Google Analytics 4

Your custom parameter should match anything you entered in “additional query parameters” in your advanced Site search event settings.

When creating a custom parameter, follow this schema:

Name the parameter: q_<additional key=””>

Between the quotation marks, write the exact name of the additional query parameter from your Site search event advanced settings.

For example, if we return to the example from Zara’s website, this is how we would configure the custom parameter: q_<additional key=”section”>

The data associated with that parameter will then be collected for use in your site search reports every time the view_search_results event is fired.