GA4 search terms – Track & analyze on-site searches

Do you know what your visitors are searching for on your site or web shop? If not, free up some minutes to configure Google Analytics 4 to collect on-site search terms. In the reports, you will find useful insights about what your users really want to learn or buy from you. Excited? Let’s dive in…

Key Takeaways

  • Google Analytics 4 search terms refer to what people search on your site or web shop. That’s different from the search terms they use in Google, Bing, etc.
  • Understanding the anatomy of the search query on your site is important to collect all the data you can get. 
  • For 80% of the sites, it only takes a couple of minutes to configure GA4 to collect search terms. But even for the other 20%, the effort is 100% worth it.
  • Knowing what visitors search for on your site or ecommerce store gives you insights into what visitors want to learn and buy (but maybe can’t find). This data can also reveal some issues with your site.
  • In GA4, you can find search terms data in a detailed report, or use it as a dimension in custom exploration reports.
  • GA4 site search doesn’t work retroactively, so you’d better set it up today. 
Willy Wonka meme google analytics 4

Understanding a site search query string 

It is smart to do at least one search on a site or web shop before you configure Site Search in GA4.

Don’t do it now, but look at the screenshot I took while searching on Amazon. It briefly explains the anatomy of a search query string. 

Example search query parameters
  • Visitors can enter a search term in a site search box. When they hit Enter or click a button that says “Search”, the URL in the address bar of the browser changes. 
  • The URL can contain two kinds of parameters that are important for Google Analytics 4.

Let’s have a closer look at them. 

GA4 Search Term Query Parameter

The search term query parameter shows someone is searching on a site. This is usually: “q”, “s”, “search”, “query”, or ”keyword”. 

But as the example of the search I did on Amazon shows, it can be as well “k”, or anything else. 

You really need to check this before diving into GA4. 

Alina, who is a member of our data-driven community, always does. On one customer’s site, she noticed the URL did not contain any of the default search term query parameters. 

No default ga4 search query parameter

Keep her advice in mind, it can save you sleepless nights: 

Pay attention to the first character following the question mark, which appears right after the trailing slash post the hostname.

Alina Elvira Popa, Freelance Digital Marketer at https://alinapopa.ro/

Your homework isn't finished.

The query may contain other parameters too. It would be a shame to not collect all the data that is available.

GA4 Additional Query Parameters

These can collect additional information for every search query. An Amazon search query, for example, contains “ref, refresh, prefix”.

Before you continue, try to figure out what these parameters actually mean. 

Talk to your developer, or consult the documentation of the software your site uses to display search results on your site. 

To illustrate how important that is, I want to quote Fred Pike, who is also a highly experienced member of our community: 

If you use a dedicated search engine like Coveo, which tracks and further refines all the search terms, it's a good idea to also recreate the GA4 view_search_results tag, which won't fire by default with Coveo

Fred Pike, Managing Director and GA & GTM Practice Lead at NwsDigital.com

Now you know the search query parameters of your site, you can do the simple part: activating the site search enhanced measurement. 

How to activate site search terms in Google Analytics 4?

GA4 can collect the search terms your visitors type in a site search box. To activate this functionality, follow these steps. 

Step 1: Go to the admin panel

Google Analytics 4 admin button

Click Admin in the left bottom corner.

Step 2: Go to your data streams

Data streams navigation menu ga4

You can find this under Property setting -> Data collection and Modification -> Data Streams

Step 3: Open data streams settings

Open data stream settings ga4

Click on the web stream for which you want to activate the GA4 site search data collection. 

Step 4: Activate enhanced measurement

Ga4 enhanced measurement activate

Switch the enhanced measurement toggle on so it turns blue. Then click on the cog right below it. This will open a panel with settings.

Step 5: Activate site search

Activate site search ga4

Scroll to Site search and switch the toggle on so it changes from gray to blue.

Step 6: Optionally, adapt the search query parameters

Query parameters site search ga4

You can adjust the search query parameters that GA4 uses to capture search terms of your visitors. That can be necessary for custom-built sites, but most times, the ones that are listed here (q, s, search, query, keyword) will do the job.

When in doubt, talk with your developer. 

Step 7: Optionally, collect more information

additional query parameters site search ga4

You can add up to 10 additional query parameters to collect more information. Separate them with a comma and don’t bother about capital or small letters, because they are case insensitive.

From now on, GA4 will collect the search terms of your visitors. But it can take up to 24 hours before you see it. That’s way too long and you can best check immediately if everything is configured correctly. 

To do so, you can either use the debug view, or have a look in the real time report, as I explain below. 

Where can I find GA4 search terms?

If the enhanced Site Search measurement is activated in GA4, you can find the search terms in different places.

  • The real time report is ideal to check if GA4 is collecting the data.
  • The built-in view_search_results report contains basic data.
  • You can export the search terms data to a CSV or PDF file.
  • Or you can create an exploration report and use the search terms dimension.

Real time searches on your site

In Google Analytics 4, you can see what people have been searching for on your site in the last 30 minutes. This is a handy report to check if the Site Search collection is properly configured.

To do so, open your site and perform a search. Use a term that you can easily identify, like “test search”.

Then, in Google Analytics 4, do these steps:

  • Open Reports -> Real-time report
  • Scroll down to the card “Event count by event name”.
  • Then, click on view_search_results
ga4 real time report view search results
  • Then click on “search term”.
Ga4 real time search term
  • If everything is set up correctly, you will see the search term you just typed in. In my case, that was “test search”. 
Search term parameter ga4

Of course, nobody has time to monitor live search terms and take notes of them. 

Aint nobody got time for that

So, let’s look at a more useful report.

The GA4 view search terms report

To open the site search terms report, just click Reports > Engagement > Events. 

ga4 menu events

You can type in “search” in the search box on top of the table of events.

search box events report ga4

Then, click on the event name view_search_results to open the report.

Ga4 view search results

Here, you can, for example, see the total number of users that triggered the view_search_event during the selected date range.

view search results report ga4

Interesting. 

But scrolling down the report reveals more useful data.

You can, for example, see on the map in which regions visitors searched on your site. If you collect demographic data in GA4, you can also see gender related data. 

search data region gender ga4

And finally, you also get an overview of all search terms for the selected period.

Search term card ga4

This too is nice, but cumbersome if there are quite some users that use your site’s search functionality. 

Luckily you can easily fix that. 

Export the GA4 view search terms data to a spreadsheet

You can export the search term data and use it in your favorite spreadsheet program or analytics tool. This is also useful if you want to share the data with someone who doesn’t have access to your GA4 account.

To export the search terms data, click on the share button on top of the page and then download it as a PDF or CSV file. 

Download search terms ga4 spreadsheet

The search terms are listed in the rows that start with “# Page Title”. In the example below, for instance, that corresponds to “You searched for”. 

Export search results search terms csv ga4

The screenshot of a search terms export confirms that some people are weird. 

Don’t waste your time on spammy search terms. 

And don’t overthink why someone would look up “something fishy” if that has nothing to do with what your site or web shop offers.

The CSV file also contains a list of referral URLs. These are the pages users visited right before search results were displayed on your site or web shop. 

Site search referral ga4 export

While all of that is cool, it also kind of sucks. Wouldn’t it be more handy if the exported report contained the search terms? 

Yeps. 

How to create a search term custom dimension in GA4

In GA4, you can create a custom dimension for search terms. That will allow you to see the data in the export of the view_search_reports and explorations. 

Fred and Alina gave this as an additional expert tip.

It’s wise to follow their advice. 

Not because that previous sentence rhymes, but it will make it easier to analyze the search terms data. 

Go to Admin > Property Settings > Data Display > Custom definitions

Create custom definitions ga4

Then hit the big blue button Create custom dimension.

create custom dimension button ga4

Fill in the following values in the fields:

  • Dimension name: search_term
  • Event parameter: search_term
  • Scope: event

Then click the Save button.

search term custom dimension ga4

If you are curious about what that stuff is all about, you can read our article that helps you understand custom dimensions in GA4

Now, let’s look at a bit more advanced report that is useful for web shops or big content sites. 

How to create an exploration report for on-site searches?

GA4 exploration reports are a great way to use data of what people search for on your site or e-commerce site in combination with other data. 

To create such a report, follow these steps.

Step 1: Create a new blank exploration

Ga4 start new blank exploration report

Click Exploration in the left-hand menu and then Blank.

Step 2: Give your report a name

name on site search exploration ga4

You can best give your report a name, like “On site search”. That will prevent panic in the search marketing department. 

Step 3: Click on the + sign of dimension

Add dimension variable exploration ga4 report

Since your report is empty, you first need to add a dimension to the Variables panel. 

Step 4: Import the search term dimension

Search term dimension ga4

Select the Search Term dimension and then click the blue Import button. 

Step 5: Use the dimension as row

Search term dimension row exploration ga4

Drag the newly added dimension to a field under Rows in the settings panel.

Step 6: Add metrics to your report

Add metrics search terms exploration ga4

In the Variables panel, click on the + sign next to metrics.

Step 7: Add metrics to the Variables

Select metrics search terms ga4

If you click Expand all compatibles, you will see a list of metrics you could use in the exploration. Select the one you need and then click Import.

Step 8: Add metrics to your search terms report

Add values search terms exploration google analytics 4

The last step is to drag the metrics to Values of the Settings panel.

Your exploration is now ready.

search term exploration example

Now you know where you can find search terms in GA4, it’s time to answer one last question.

What can you actually do with GA4 search terms data?

Knowing what visitors are searching for on your site or web shop can reveal insights about several aspects of your site.

Detect content gaps

If many visitors are searching for a specific term that isn’t covered on your site or blog, you may create content for it.  

Of course, this only makes sense if it is related to your business or organization.

Detect commercial opportunity gaps

On-site searches give an obvious hint about what visitors actually want to buy from your web shop. If your ecommerce site doesn’t offer the brands or products that are collected in the search terms report, you may consider selling them.

The same applies to businesses that offer services or sell digital products. 

The Data Driven Insiders program, for example, gives digital marketers like you access to learning resources. It also has a great community of experts like Fred and Alina, who both contributed to this article. 

Detect user experience issues

Everyone believes their site is user friendly and assumes visitors can easily find information or products without doing an on-site search. 

GA4 site search terms data can reveal a completely different reality. 

  • Users may find it difficult to get straight to the information or product they want. 
  • Your site search result page or functionally may suck. The faster people find what they need, the more likely they will stay on your site. 

To illustrate that you can really go deep, Alina gave another example of how search terms can help you detect user experience issues. 

We can also create a funnel in the “Explore” section that starts with users viewing search results and ends with the conversion event. This will visualize the conversion path and show you where users are dropping off in the funnel.

We covered how to set up reverse funnel paths in GA4 already on our blog, so I only include a screenshot here.

Search terms can be used in reverse funnel exploration. Source: Alina Elvira Popa 

reverse funnel exploration start search term

What’s your next best move?

On-site search data is first party data. Your visitors are telling you what they want from you. All you need to do is listen carefully. 

Google Analytics 4 helps you with that. 

It is easy to collect on-site search terms and the data can reveal hidden opportunities for your content team, web designer, and sales team.

So, go and activate “Site Search”. 

Finally, I want to thank Alina and Fred for sharing their great insights. 
If you want to ask them and other data-driven marketers any questions about data-driven marketing, check out our Data Driven Insider program.

Scroll to Top