GA4 view_search_results event search_term parameter documentation: Setup and Reporting

Quick Answer
If you're looking for GA4 view_search_results event search_term parameter documentation, the essential point is that GA4 can automatically track searches performed on your website through the view_search_results event when Enhanced Measurement is enabled and a search-results URL contains a recognized query parameter. The search_term parameter records the phrase visitors searched for. GA4 recognizes q, s, search, query, and keyword by default. If your website uses another parameter, such as term, configure it in your web data stream. Verify the event and its parameters in DebugView before relying on reports.
Key Takeaways
view_search_resultsis the GA4 event for displaying website search results.search_termcarries the visitor's search phrase.- GA4 recognizes five default search query parameter names:
q,s,search,query, andkeyword. - You can configure additional parameter names through Enhanced Measurement.
- DebugView helps confirm whether the event and search phrase are actually collected.
- Search term is available as a predefined GA4 reporting dimension; creating a duplicate custom dimension is generally unnecessary.
- Internal website searches and Google organic search queries are different measurements.
What Is the GA4 view_search_results Event?
The view_search_results event records when a visitor is presented with a search-results page on your website or application.
For example, imagine someone visits an online store and searches for "running shoes." The website displays a results page containing matching products. GA4 can record that interaction through view_search_results and associate the search phrase with the search_term parameter.
This information helps website owners understand what visitors are looking for after arriving on their websites.
You might discover that:
- Visitors frequently search for products that are difficult to find through navigation.
- Certain services attract more internal searches than others.
- People search for terms that your website does not adequately cover.
- Visitors repeatedly search for information that deserves a more prominent position.
The event is particularly useful for content planning, navigation improvements and understanding customer needs.
Google documents this behavior in its official Enhanced Measurement events documentation.
view_search_results versus search_term
These two names describe different parts of the same measurement process.
| Measurement | Meaning |
|---|---|
view_search_results | The event recorded when a site-search results page is presented. |
search_term | The parameter containing the visitor's search phrase. |
| Search term | The GA4 reporting dimension used to analyze collected search phrases. |
For example, if someone searches for "running shoes," the expected event and parameter relationship is:
``text
Event name: view_search_results
Parameter: search_term
Parameter value: running shoes
``
The event tells you that a search-results interaction occurred. The parameter tells you what the visitor searched for.
Google's GA4 event reference documents the event and its parameters.
How GA4 Detects Website Search Queries
GA4 Enhanced Measurement identifies site searches by checking the URL of the search-results page for recognized query parameters.
A query parameter is the part of a URL that appears after a question mark and contains information passed to the website.
For example:
``text
https://example.com/search?q=shoes
``
Here:
searchis the page path.qis the query parameter name.shoesis the search value.
GA4 recognizes five default search query parameter names:
| Parameter | Example search URL |
|---|---|
q | /search?q=shoes |
s | /?s=shoes |
search | /results?search=shoes |
query | /search?query=shoes |
keyword | /find?keyword=shoes |
These are alternative URL structures. Your website does not need to use all five.
If a visitor searches for "shoes" and your website generates /search?q=shoes, the q parameter is already among GA4's documented defaults.
However, having a search box does not automatically mean that GA4 will collect its searches. The results-page URL, Enhanced Measurement configuration and actual event collection must all be checked.
Read Google's official site-search measurement instructions for the documented parameter behavior.
How to Configure Custom Search Parameters in GA4
Some websites use URL parameters that are not included in Google's five defaults.
For example, a website might generate this URL:
``text
https://example.com/find?term=analytics
``
The parameter is term, not q, s, search, query or keyword.
GA4 therefore needs to be configured to recognize term as a search query parameter.
Step 1: Identify your website's search URL
Open your website and perform a search using a distinctive phrase.
For example, search for:
``text
analytics testing example
``
After the results appear, inspect the browser address bar.
You might see:
``text
https://example.com/find?term=analytics+testing+example
``
Record the parameter name. In this example, it is term.
Do not assume that the search parameter is always q. Different content management systems and custom website applications can use different URL structures.
Step 2: Open your GA4 web data stream
- Open your Google Analytics property.
- Navigate to the Admin area.
- Find the relevant web data stream under Data collection and modification.
- Open the Enhanced Measurement settings for that stream.
- Confirm that Enhanced Measurement is enabled.
Make sure you are working with the stream that receives data from the website you are testing.
Step 3: Review the page-view measurement settings
Open the Enhanced Measurement configuration and locate the page-view settings.
The site-search configuration allows you to specify additional URL query parameter names that GA4 should recognize.
Add the parameter identified in Step 1.
For the example website, the additional parameter is:
``text
term
``
Save the configuration.
Google also documents the configurable settings in its EnhancedMeasurementSettings API reference.
Step 4: Test another search
Return to your website and perform another search.
Use a different phrase so you can distinguish the new test from other activity.
For example:
``text
https://example.com/find?term=website+analytics
``
The expected result is a view_search_results event associated with the search phrase website analytics, provided the configured collection conditions are satisfied.
Do not add unrelated parameters such as sort, page, category or filter simply because they appear in the URL. Only configure parameters that actually represent the visitor's search query.
Understanding the search_term Parameter
The search_term parameter is central to internal search reporting because it identifies the phrase associated with a search event.
Consider a website visitor who searches for three different things:
- SEO services
- Backlink indexing
- Google Analytics tracking
When the relevant searches are collected correctly, GA4 can associate each view_search_results event with its corresponding phrase.
Conceptually, the collected information looks like this:
| Event name | search_term |
|---|---|
view_search_results | SEO services |
view_search_results | Backlink indexing |
view_search_results | Google Analytics tracking |
This is an illustrative example, not actual Analytics data.
The parameter is useful because it turns a general event count into information about what visitors are trying to find.
Do you need to create a custom dimension?
Usually, you should check the predefined Search term dimension before creating anything new.
A dimension is a descriptive attribute used to organize and analyze Analytics data. In this case, Search term represents the phrase associated with the collected search event.
Google's current Analytics dimensions and metrics reference lists Search term as a predefined General dimension populated through the search_term parameter on relevant events, including search and view_search_results.
There is an important documentation distinction here.
Google's Site Search Explore playbook includes instructions involving custom-dimension configuration. However, the current dimensions reference identifies Search term as a predefined dimension.
The sensible approach is to check whether Search term is already available in your property and exploration before creating a new custom dimension.
If you want to report on a genuinely additional parameter that has no predefined dimension, a custom dimension may be appropriate. Follow Google's custom-dimension guidance and avoid duplicating existing dimensions.
How to View Internal Search Terms in GA4 Reports
Once GA4 collects the events and parameters, you can analyze the phrases visitors use through Explorations.
A free-form exploration is a flexible report that allows you to arrange dimensions, metrics and filters to answer a specific question.
Create a site-search exploration
Follow this workflow:
- Open your GA4 property.
- Select Explore.
- Create a free-form exploration.
- Add Search term as a dimension.
- Add an appropriate event-count metric.
- Place Search term in the Rows section.
- Add Event name as a filter.
- Set the filter to exactly match
view_search_results.
Your exploration should now focus on search phrases associated with the site-search event.
The event-name filter is important. Without it, the report may include unrelated events for which Search term has no applicable value. Those rows can display (not set) and make the report harder to interpret.
What should you look for?
Once the exploration contains search phrases and their event counts, look for patterns rather than focusing only on the most popular term.
For example:
- Frequently searched products may deserve more prominent navigation.
- Searches that produce poor results may indicate gaps in your website's content or product catalog.
- Repeated searches for the same subject may indicate that visitors are struggling to find relevant information.
- Unexpected searches can reveal content opportunities that your current navigation does not address.
A high search count does not automatically mean that visitors are satisfied. It identifies demand, not the quality of the search experience.
For Google's documented workflow, see the GA4 site-search Explore playbook.
It is also important to distinguish internal searches from organic keyword performance. GA4 site-search terms describe what visitors search for after reaching your website. Google Search Console reports organic-search performance from Google Search. They answer different questions.
For a broader explanation of analytics and traffic measurement, see website traffic analysis tools. You can also learn how to see which keywords a page is ranking for using Search Console and SEO tools.
How to Verify view_search_results Using DebugView
A successful page load does not prove that GA4 recorded a site-search event.
You should check the event itself and inspect its parameters.
Google Analytics DebugView lets you examine events received from a device in debugging mode. It is useful for testing an implementation before relying on standard reports.
Google provides instructions in its DebugView documentation.
Verification procedure
1. Enable debugging.
Use Google Tag Assistant or the appropriate debugging configuration for your implementation.
2. Open your website.
Use the same website and environment connected to the GA4 property you intend to test.
3. Perform an internal search.
Enter a distinctive phrase, such as:
``text
site search verification 2026
``
4. Open DebugView.
In your GA4 property, navigate to DebugView and select the relevant test device if necessary.
5. Find the event.
Look for:
``text
view_search_results
``
6. Inspect its parameters.
Open the event details and look for:
``text
search_term
``
7. Compare the collected value with your test.
If you searched for site search verification 2026, that phrase should be associated with the event when collection is configured correctly.
The important checks are:
- Did GA4 receive
view_search_results? - Did the event include
search_term? - Does the parameter value match the phrase entered?
If all three checks succeed, you have evidence that the tested search interaction is being collected as expected.
If they do not, investigate the URL and configuration before assuming that the reporting interface is the problem.
For additional implementation checks, consult Google's GA4 troubleshooting documentation.
GA4 Site Search Configuration and Troubleshooting Matrix
The following matrix connects the website's actual URL structure with the relevant GA4 configuration and verification steps.
All URLs are illustrative examples, not independently tested implementations.
| Website search URL | Parameter | Configuration | Expected result |
|---|---|---|---|
/search?q=shoes | q | Default | view_search_results with search_term when collection conditions are met |
/?s=shoes | s | Default | view_search_results with search_term when collection conditions are met |
/search?query=shoes | query | Default | view_search_results with search_term when collection conditions are met |
/find?term=shoes | term | Add custom parameter | Event and search term when configured correctly |
/search#q=shoes | URL fragment | Standard query-parameter detection does not establish collection | Review the implementation |
Use the table as a starting point, not as a guarantee that every search interface will work identically.
The actual result depends on the website's URL structure and GA4 implementation.
A simple diagnostic sequence
When site-search tracking does not work, investigate the following stages in order:
Stage 1: Actual search URL
Does submitting a search produce a results URL containing the search phrase?
If not, determine how the website's search interface communicates its query.
Stage 2: Parameter recognition
Is the query parameter one of Google's five defaults, or have you added the correct custom parameter?
Stage 3: Enhanced Measurement
Is Enhanced Measurement enabled on the correct web data stream, with the appropriate site-search settings?
Stage 4: Event collection
Does DebugView show view_search_results after you perform a search?
Stage 5: Parameter collection
Does the event contain search_term with the expected value?
Stage 6: Reporting
Is the predefined Search term dimension available, and is your exploration filtered to the correct event?
This sequence prevents a common troubleshooting mistake: trying to repair a reporting configuration before confirming that the underlying event was collected.
What If Your Website Does Not Use Search Query Parameters?
Not every website uses a traditional search-results URL.
Some applications update search results without changing the browser address bar. Others use JavaScript interfaces, dynamic content updates or URL fragments.
For example, a visitor might enter a phrase into a search box and see new results without navigating to a URL containing ?q=... or another recognized parameter.
In that situation, standard URL-based Enhanced Measurement detection may not capture the interaction as expected.
A developer may need to implement event tracking based on the actual search interaction.
Google's recommended events documentation describes the separate search event and its search_term parameter. The view_search_results event is specifically associated with displaying search results.
See the GA4 event reference for the documented event definitions and parameters.
Before adding custom tracking, establish which event your implementation needs and how the search interaction should be measured.
Avoid sending the same search interaction twice through overlapping automatic and custom triggers. Duplicate events can inflate reported search activity and make the resulting analysis unreliable.
After implementing a custom solution, repeat the DebugView verification procedure and inspect the event payload.
Privacy Considerations for Search-Term Tracking
Website search boxes can contain more than product names or informational queries.
Visitors might enter:
- Email addresses.
- Telephone numbers.
- Account identifiers.
- Personal details.
- Other sensitive information.
This creates an important data-collection risk.
Google requires administrators to ensure Enhanced Measurement does not collect personally identifiable information. Review what visitors can enter into search fields and make sure sensitive values are not transmitted to Google Analytics.
Do not assume that a search phrase is harmless simply because it appears in a URL.
Review the Google Enhanced Measurement documentation and the privacy requirements applicable to your website before enabling collection.
Frequently Asked Questions
What does view_search_results mean in GA4?
It is an event that records when a visitor is presented with a website or application search-results page. Enhanced Measurement can collect it automatically when the documented conditions are satisfied.
What is the search_term parameter in GA4?
search_term is the event parameter that contains the phrase a visitor used in an internal website search. It provides the actual search text associated with the event.
Which URL parameters does GA4 recognize automatically?
The documented default search parameters are q, s, search, query and keyword. Additional names can be configured in Enhanced Measurement.
Can GA4 track a custom search parameter such as term?
Yes. If your website uses a URL such as /find?term=shoes, add term to the site's search-query parameter configuration and verify the resulting event in DebugView.
Do I need to create a custom dimension for search_term?
Usually not. Google lists Search term as a predefined dimension. Check its availability before creating a new dimension that duplicates existing functionality.
Why is search_term showing as (not set)?
Possible reasons include missing search parameters, incorrect configuration, unrelated events included in the report or an implementation that does not send the expected parameter. Check the event and its payload in DebugView first.
Can GA4 track searches that do not change the page URL?
Standard URL-based site-search detection may not identify these interactions. A custom implementation may be needed to record the search event and its associated term.
Can I recover searches that happened before tracking was configured?
You should not assume so. If the event and parameter were not collected at the time, configuring tracking now does not guarantee that historical search phrases can be recovered.
Final Thoughts
The most reliable way to understand GA4 internal search tracking is to follow the complete measurement process: identify the search-results URL, configure the correct query parameter, collect view_search_results, inspect search_term, and verify the reporting dimension.
Start with the actual search behavior of your website rather than assuming that every search function uses the same URL structure. Test the implementation in DebugView before using the results to make content, navigation or product decisions.
That is the practical value of understanding the GA4 view_search_results event and search_term parameter documentation: you can move beyond simply counting visits and begin understanding what people are actively trying to find on your website.
---