How to Track Site Search in Google Analytics
Hearing exactly what your customers want, in their own words, is marketing gold. That's precisely what your website's search bar offers every single day. If you aren't tracking what users are typing into that little box, you're missing out on a direct line to their needs and intentions. This guide walks you through setting up site search tracking in both Google Analytics 4 and Universal Analytics (UA), and more importantly, how to turn that data into real improvements for your business.
Why Tracking Site Search is a Game-Changer
Setting up site search tracking isn't just about collecting more data, it's about uncovering a rich source of user feedback that you can act on immediately. When a visitor uses your search bar, they are literally telling you what they are looking for. This data is invaluable for several reasons:
- Uncover What Users Actually Want: You might think your "Services" page is perfectly clear, but if users are constantly searching for a specific service, that's a sign you need to make it more prominent.
- Identify Content and Product Gaps: If dozens of people are searching for a product you don't carry or a topic you haven't written about, you've just discovered a clear gap in your offerings. This is your audience directly telling you how you can better serve them.
- Improve Website Navigation (UX): High search volume for items buried deep in your site structure signals a navigation problem. If users can't find it easily through menus, they'll turn to search. Tracking this helps you identify friction points and simplify your user experience.
- Discover Customer Language and Keywords: Learn the exact terminology your audience uses. Do they search for "running shoes," "sneakers," "trainers," or "athletic footwear"? This is a goldmine for SEO and ad copy, allowing you to speak your customers' language.
Before You Start: Find Your Search Query Parameter
To tell Google Analytics what to track, you first need to identify your site's "search query parameter." It sounds technical, but it’s surprisingly simple to find.
A query parameter is the part of a URL that tells the server what specific content to display. In the case of site search, it’s the piece of the URL that signifies which keyword was searched for. Here's how to find yours in 30 seconds:
- Go to your website.
- Use your website's search bar to search for a test term, like "contact" or "test."
- Look at the URL on the search results page. You'll see your search term appear in the URL after a question mark (?) and a specific letter or word followed by an equals sign (=).
The letter or word between the question mark ? and the equals sign = is your query parameter. It’s often as simple as s, q, or a word like query or search_term.
For example, a URL might look like this:
https://www.yourstore.com/search?s=blue+widgets
In this case, your query parameter is "s".
Or it might look like this:
https://www.yourblog.com/?q=analytics+tips
Here, the query parameter is "q".
Take note of your parameter. You'll need it in the next steps.
How to Set Up Site Search Tracking in Google Analytics 4
The good news is that Google Analytics 4 is much smarter about tracking site search automatically. GA4's "Enhanced measurement" feature often detects and tracks site search activity without any configuration needed. Your first step should be to check if it's already working.
Check if Enhanced Measurement is Working
- In GA4, go to the Admin section by clicking the gear icon in the bottom-left.
- In the Property column, click on Data Streams.
- Select the appropriate web data stream for your site.
- Under the Events section, make sure the Enhanced measurement toggle is on. Then, click the gear icon to its right.
- In the panel that appears, look for Site search. If the toggle is on, GA4 is already tracking it!
GA4 automatically detects the most common query parameters like q, s, search, query, and keyword. If your parameter is on that list, you're likely all set.
Manually Adding Your Query Parameter in GA4
If your website uses a less common query parameter, you may need to tell GA4 what to look for. You'll find this setting in the same Enhanced Measurement panel.
- Follow the steps above to get to the Enhanced Measurement settings.
- Click on Site search. You'll see a link that says Show advanced settings.
- Here, you will see a box labeled Search Term Query Parameters.
- Enter the query parameter you found earlier (e.g., 's' or 'query'). If you have more than one, you can separate them with a comma.
- Click Save.
That's it! GA4 will now track searches on your site as an event called view_search_results, and the keyword the user searched for will be captured within that event as a parameter called search_term.
Where to Find Site Search Data in GA4
Once tracking is active, you can find your data in a few places:
- The Events Report: Go to Reports > Engagement > Events. After a day or two, you should see
view_search_resultsin your list of events. Clicking on this event will show you cards with more details, including a list of the search_term values. - Explorations: For more detailed analysis, using the Explore section is best. You can create a new "Free Form" exploration, use
Event nameas your rows (filtered to only showview_search_results), and then addSearch termand metrics likeEvent countandTotal usersas the values to build a custom, in-depth report.
How to Set Up Site Search Tracking in Universal Analytics (UA)
While Google Analytics 4 is the current standard, many businesses still have historical data in Universal Analytics or prefer its reporting interface. Setting up site search tracking in UA is also straightforward.
- Navigate to the Admin section of your Universal Analytics account.
- In the far-right View column, click on View Settings.
- Scroll down to the bottom until you see the Site Search Settings section.
- Toggle Site search Tracking to ON.
- In the "Query parameter" field, enter the search query parameter you identified earlier (e.g., 's' or 'q'). Do not include the question mark or equals sign.
- (Recommended) Check the box that says Strip query parameters out of URL. This prevents you from seeing duplicate page entries in your content reports (e.g.,
/search?s=hatsand/search?s=shirtswill both be consolidated under/search). - Click Save.
Data will begin populating in your reports within 24-48 hours.
Where to Find Site Search Data in UA
The reports in Universal Analytics are neatly organized. To see what people are searching for, go to:
Behavior > Site Search > Search Terms
This report will show you a clean table with all the terms users have searched for, along with key metrics like the number of searches, % search exits, and more. You can also explore the Usage, Overview, and Pages reports in this section for more context.
Actionable Insights: What to Do With Your Site Search Data
Collecting the data is the easy part. The real value comes from turning it into action. Here are a few key reports to watch and what to do with what you find.
1. High Search Volume, Low Engagement
Look at your Search Terms report. Do you see terms with a high number of searches but also a high "% Search Exits" or a very short "Time after Search"? This is a red flag. It means users are searching for something, looking at the results you provide, and then leaving because it's not what they wanted.
- The Fix: Manually search for these high-volume terms on your own site. Are the results relevant? Is the right product or article showing up first? If not, you may need to optimize product descriptions, re-tag content, or create a brand-new page specifically addressing that term.
2. Zero Result Searches
This is arguably the most valuable report of all. In UA, this is part of the Search Terms report when you look at terms with "Total Unique Searches" but 0 "Results Pageviews." It signifies searches that return no results found. These are dead ends for your users.
- The Fix: Treat this list as your to-do list for new content or products. Your users are shouting at you, telling you what they want to buy or learn. You can also fix this on the backend by setting up synonyms in your content management system (CMS) — for example, redirecting a search for "slacks" to your "pants" category.
3. High Search Refinements
In Universal Analytics, under the Search Terms report, this metric is called "% Search Refinements." This measures how often a user searches for one term immediately followed by another. For example, they search for "shoes," then "red shoes," then "red running shoes." It means your initial search results were too broad or your filtering/category options aren't intuitive enough.
- The Fix: Analyze these user journeys to see how people are narrowing their focus. It might reveal a need for better on-page filtering (by color, size, brand) or improved product categorization to help people find what they need with fewer clicks.
4. Discover Your Customers' Vernacular
Pay close attention to the exact words people use. They might be using acronyms, misspellings, or industry slang that you haven't incorporated into your copy. They might search for technical SKU numbers instead of product names.
- The Fix: Start using this language in your copy. If customers consistently search for the “XJ-400 model,” add it to your product titles and descriptions. Incorporating this language demonstrates you understand your customers and makes your content more findable, both on your site and on search engines like Google.
Final Thoughts
Setting up site search tracking in Google Analytics transforms a simple on-site feature into a powerful feedback tool. By listening to what your users are asking for, you can systematically remove friction, fill content gaps, and create a better experience that directly addresses their needs.
Of course, digging through GA reports to connect search terms to actual sales or campaign performance manually can still take time. We found ourselves constantly jumping between Google Analytics, Shopify, and our ad platforms to connect the dots. We wanted an easier way to just ask, "What are the top 10 on-site search terms that led to a purchase last month from users who came from Facebook Ads?" With Graphed, you can do just that by connecting your data and asking questions in plain English, getting instant answers and visualizations without the headache of report-building.
Related Articles
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.
How to Create a Photo Album in Meta Business Suite
How to create a photo album in Meta Business Suite — step-by-step guide to organizing Facebook and Instagram photos into albums for your business page.