Search
Menu

Only that slider did move. Where the slider is, what to look out for and thus how to set up Site Search with Google Analytics I will show you in this article.

Before you begin: first, you must have Google Analytics 4

When you want to make search queries measurable with Google Analytics 4, it is of course important that you first have Google Analytics 4 and have linked it to your website.

How to do that, I'm not going to explain to you in this article. After all, that's a full article in itself.

Of course, I've written that one a long time ago. In the following article you will find exactly how to create Google Analytics 4 and then link it with Google Tag Manager.

Tutorial: loading Google Analytics 4 via Tag Manager.

Setting up Site Search in 6 Steps with Google Analytics 4

Do you have a search function within your website?

Probably so.

But do you know if that feature is used often and what exactly people fill out?

My guess is no.

If not, you are currently missing a lot of opportunities.

For example, did you know that you can use this as inspiration for your findability and optimization of your website?

Because when people fill in a word often, it's something they want to see/find quickly.

So you can use that information nicely to make your website even better for your visitors (and Google!).

High time, then, to tell you all about how to set up this gold mine.

Step 1: Go to the Google Analytics website and then go to the appropriate Google Analytics 4 property.

Step 2: Click on "Manage" at the bottom left.

Step 3: Click on "Data Streams.

sitesearch-instellen-google-analytics-4

Step 4: Click on the appropriate data stream.

Data stream analytics 4

Step 5: Click the cog icon in the "Enhanced Measurement" box.

turn on site search

Step 6: Turn on the "Search the site" slider.

Search the site Google Analytics

It's that easy to turn on Site Search within Google Analytics 4. Unfortunately, you're not there yet. There are two more things to do.

I want you to go to the search function of your website right now and type something in there. If you type something in and then click enter. What URL will you see?

The URL within my WordPress website becomes https://onlinemarketingagency.com/?s=test.

The letter or letters after the ? in your URL are called the query parameter. That one is very important.

In fact, Google Analytics 4 has some default of those parameters, but if you have a non-standard CMS, Analytics 4 may therefore not recognize your parameters.

If you click on "Show Advanced Settings" in the image above, you will see that Google Analytics 4 has the following parameters by default:

  • q
  • s
  • search
  • query
  • keyword

Is the letter or letters after the ? in your URL not listed? Then put a comma after the keyword and complete it with your parameter.

This will look like this: q,s,search,query,keyword,sitesearch

Make sure it works and find out what people enter in the search function

The very last steps are checking that it works and finding out what people enter in the search function.

To do this, of course, you must first use the search function on your website. Once you have done that, you need to go to the "Realtime" heading within Google Analytics 4.

Then on the right you will see a block with 'Number of events'. You should see your 'view_search_results' there.

search result event

Now that you know it works, you also want to know people have entered it in your website's search function.

Unfortunately, Google Analytics 4 does not yet track all searches neatly. Currently, only search results from the past 30 minutes are tracked.

You can find these out by clicking on "Events" on the left under the heading "Engagement.

Then click on your 'view_search_results' in the list of events.

view search results

And then set the parameter name on the right to 'search_term'.

search term parameter name

Making search terms insightful in your Google Analytics 4 Reports

If you also want the search terms to be visible in your Google Analytics 4 reports, you need to perform an additional step. Fortunately, we've already written a blog about this, so you don't have to figure this out yourself.

Getting Google search terms insight into your Google Analytics 4 reports

When you go through steps 1 and 2 of the blog in the link above, you'll be all set to get your search terms visible in your reports as well!

And more

Since I think you'll want more helpful tips and tutorials on Google Analytics 4, I've listed them all here for you.

How is Site Search in Google Analytics 4 different from previous versions of Google Analytics?

Site Search in Google Analytics 4 (GA4) is designed with a different interface and has different settings compared to the older versions. GA4 puts more emphasis on event-driven data and real-time reporting, and this also affects how Site Search is presented and analyzed in the platform. The specific process to set up Site Search has also changed in GA4, as described in the blog.

Is there a limit to the number of search terms that Google Analytics 4 can track?

There is no explicit limit mentioned for the number of search terms GA4 can track. However, as the blog mentions, GA4 currently only tracks search results from the past 30 minutes, which may be a limitation for some users.

Can I migrate old Site Search data from a previous version of Google Analytics to Google Analytics 4?

There is no standard process to migrate data directly from older versions of Google Analytics to GA4, mainly because GA4 uses a completely new measurement system and data structure. However, both versions can run simultaneously on a Web site, allowing users to compare and analyze data from both sources.

Is there a cost for using the Site Search feature in Google Analytics 4?

No, the Site Search feature in GA4 is free to use. However, if you use advanced features or process a large volume of data with Google Analytics, there is a cost for Google Analytics 360, the paid version of the platform.

2 Responses to "Tutorial: Setting up Site Search in Google Analytics 4"

  1. Hello Daniel
    I followed your steps only this is about the last 30 minutes. Now how do I see a report on my own chosen time frame.
    In addition, I have excluded myself from the statistics and that test will not work. It does if you go incognito.

    1. Hi Sandra,

      True! Currently, Google only shows the last 30 minutes. Should you want to test this, it's best to do it on your phone via 4G. Then you will have a different IP address.

Leave a Reply

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

Most frequently asked questions about this blog