What we build

Websites

Company websites and B2B platforms on WordPress or custom builds, with design, audits and speed optimisation.

Website development →

What we run

SEO

Visibility in Google and in language models. One team looks after search, your business profile and what ChatGPT and Gemini say about your brand.

Search engine optimisation →

What we run

Advertising and campaigns

Campaigns judged on net profit after returns and cost of goods, not on the ROAS in the ad platform. Creative is made in-house, so it never waits for a third supplier.

Digital marketing agency →

What we run

Analytics and data

Measurement first, decisions second. Ad, store and warehouse data in one place, so a budget conversation takes fifteen minutes, not three meetings.

Web analytics for e-commerce →
Article

Internal Site Search Tracking in Google Analytics 4: Setup Guide

Internal site search in GA4 shows what customers couldn't find on your site. Set up the report with enhanced measurement or through GTM.

Łukasz Zontek Łukasz Zontek SEO 29 February 2024 6 min read 7 sections
Internal Site Search Tracking in Google Analytics 4: Setup Guide Analytics
Trusted by

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:

Łukasz Zontek
Written by
Łukasz Zontek
SEO

Have a question about this article? Write to us.

Want this in your business

Let's turn this knowledge into results in your store

30 minutes about your numbers. The call starts with someone from sales, and we bring in the channel specialist once we get into the details. The call is free of charge.

Client reviews

Ratings of the agency that runs this blog

Clients gave them after working with us, and you can read each one on the site where it was posted. They cover the work of the whole agency, not this one article.

4.96 / 5
weighted average of 224 reviews across three platforms
Read the reviews

Statuses awarded by the platforms: PrestaShop Expert ★★★, Google Premier Partner 2025, Meta Business Partner, Microsoft Advertising Elite Partner 2025. All certificates and awards

Read on

See also

Analytics 29 April 2024 404 Error Analysis in Google Analytics [GA4] Łukasz Zontek Marketing 27 November 2025 ROAS Is a Myth: Stop Telling Fairy Tales, Read the Data Mateusz Haber Marketing 8 July 2025 ROAS Is Dead: How to Measure Real E-commerce Profitability Mateusz Haber
Contact

A conversation about your numbers: 30 minutes

The call is led by a new business specialist. When we get into the details of an account, the specialist for that channel joins in. We reply within one business day.

A quick review of your tracking and campaignsThree priorities for the next quarterA written summary that stays with you

Before the meeting we review your website, your visibility and what your campaigns show from the outside. We will not open with “so, what does your company do?”.

4.96 224 reviews
By sending the form you agree to the processing of your data in line with our Privacy Policy.

What happens after you send it
01
within 1 business day

We reply to your email

The reply comes from the same new business specialist who will run the call. No qualification form and no call from an unknown number.

02
this week

A 30-minute conversation

We go through your numbers and your questions. If it turns out we are not the right fit, we will tell you straight away.