Configuring internal site search is one of the most valuable, and at the same time one of the most frequently overlooked, elements of analytics. Internal search shows you directly what users are looking for on your site, no surveys, no guesswork, no usability testing required.
Data from GA4's internal search reports lets you identify content gaps, improve navigation and increase conversion. Below you'll find a complete guide, from setting up site search in Google Analytics 4, through enhanced measurement and implementation via Google Tag Manager, to practical optimisation based on the data you collect.
Step 1: Why monitor site search, and what does it get you as a business?
Internal site search configuration gives you information about the phrases users type into your website's search box. This lets you identify queries that point to content that's either most in demand or hardest to find on the site. This gives you a better understanding of visitors' intent without having to run surveys or usability tests.
From a business perspective, monitoring what a user types lets you connect their intent with conversions and examine their user journey. You can check whether people who use the search box are more likely to make a purchase or fill in a contact form. This is valuable analytics knowledge that genuinely supports decisions about site development and ad budget planning, including paid Google Ads campaigns and organic traffic activity (supported by data from Google Search Console).
Step 2: Setting up internal search tracking in Google Analytics 4 (GA4)
To get started, you need an active Google account, a GA4 property already created, and Google Analytics correctly implemented on your site (with a measurement ID in place). Then log in to the Google Analytics panel and go through the setup process:
- Log in to GA4 and select the right property.
- Go to Admin → Data Streams → select the stream → Enhanced measurement → the gear icon → Site search.
- Find the site search configuration option, make sure enable search tracking is switched on, and check the query parameter.
Automatic search tracking (enhanced measurement)
Enhanced measurement is GA4's default mechanism, which automatically records selected events in Google, including page views of search results and internal searches, without any code changes. There's just one condition: your search must change the URL when a query is entered. If the URL looks something like www.yoursite.com/search?q=phrase, GA4 can detect and record this event on its own as view_search_results.
To enable this, log in to the GA4 panel and go to: Admin → Data display → Data Streams → select the stream → Enhanced measurement (the gear icon). Make sure the site search option is switched on and check the query parameter (usually q, s or search). While doing this, keep privacy rules in mind and avoid sending personal data to GA4.
Setup via Google Tag Manager
If your search doesn't change the URL (results load dynamically), the default enhanced measurement won't work. In this case, you need an advanced Google Analytics implementation using Google Tag Manager and custom events.
In GTM, create a new GA4 Event tag, name it view_search_results and configure a search_term parameter that captures the phrase the user typed. As the trigger, set an event that corresponds to clicking the search button or the results page loading. Once you publish the GTM container, data will start flowing into GA4.
Important: To be able to later analyse this parameter in GA4 reports and Explorations, you need to register it in the GA4 panel. Go to: Admin → Data display → Custom definitions → Create custom dimension. Enter a dimension name (for example, Search term) and select search_term as the event parameter. Without this step, GA4 won't display the collected phrases in custom reports!
Step 3: How do you check that tracking is working correctly?
Before analysing the data, it's worth making sure the view_search_results event is actually reaching GA4. The fastest method is DebugView, a diagnostic mode available in GA4 under Admin → Data display → DebugView. Go to your site, type any phrase into the search box, and then check in DebugView whether the view_search_results event appears in the real-time events list.
If you set it up through Google Tag Manager, use Preview mode in GTM before publishing the container. This lets you see whether the GA4 Event tag fires at the moment of a search, and whether the search_term parameter picks up the correct value.
Step 4: Analysing the data in the GA4 panel
Once you've confirmed that tracking is working, GA4 starts collecting data on internal searches. It's worth analysing not just popular phrases, but also queries with no results, which directly point to gaps in your content or offer. It's also useful to check what users do after searching, whether they go on to a subpage, or leave the site.
Where do you find search results in GA4?
You'll find data on internal searches in two places. The first is the Reports → Engagement → Events section: search for the view_search_results event to see the number of searches and the most frequently typed phrases.
The second place is Explore, where you can build your own report with the search_term parameter as a dimension. This is the most convenient place to analyse specific phrases, segment users and examine post-search journeys. Explorations give you far more flexibility than standard reports and let you combine search data with conversions or bounce rate.
Step 5: Optimising your site based on search results
The data you collect on internal searches is a ready-made list of actions to implement. If a particular phrase comes up often, and the site has no content or subpage that answers it, that's a signal to fill a gap in your offer or expand your blog. Popular queries also show which product or service categories users find most interesting, which can influence content priorities and campaign planning.
Queries with no results deserve their own category. If users regularly search for something the site doesn't offer, you have two options: add the content, or improve internal linking and navigation so existing subpages are easier to find.
It's also worth checking what happens after a search. If users use the search box but quickly leave the results page, the problem may lie in the quality of the search results or how they're presented. This is an area that directly affects conversion and is worth monitoring regularly.
Site search in GA4: what's worth implementing and what to remember
Setting up internal search tracking is one of the easier implementations in GA4, and it delivers concrete data you can see quickly. If your site changes the URL after a search, you just need to enable enhanced measurement and provide the query parameter. If not, implementation via Google Tag Manager usually takes a few dozen minutes and doesn't require touching your site's code.
It's worth analysing internal search data regularly, not just once after implementation. User behaviour changes along with your offer, seasonality and ad campaigns, so the search_term report should be a permanent part of monitoring your site. It's one of the few reports that shows both what users need and points to specific places on the site to improve.
See also:









