The view_search_results event
view_search_results is a GA4 recommended event that fires when a visitor views the results of a search. It carries a search_term parameter holding the query. It captures what people look for on your site and whether results were shown — a direct window into demand and content gaps — but search terms can be sensitive and need careful handling.
What this means
view_search_results is a GA4 recommended event fired when a search results view renders, with `search_term` carrying the query. It is closely related to GA4's enhanced-measurement site-search detection, which also captures search queries from URL parameters. GA4 uses it to populate search-term reporting.
It is one of the most direct demand signals you have: people telling you, in their own words, what they want.
Demand, gaps, and sensitivity
Search terms reveal content gaps (queries with no good answer), navigation failures (people searching for things that should be easy to find), and emerging interest. But queries are free-text and can contain names, locations, health concerns, or other sensitive input. Aggregate terms for analysis, avoid tying queries to individual identities, and consider redaction patterns for obviously sensitive fields.
- Fires when search results are displayed
- Carries the search_term query
- Queries can be sensitive free text — handle with care
How it appears in analytics and logs
A view_search_results event means a visitor saw results for a query. Frequent searches for content you do not have reveal gaps; many searches overall can mean navigation is failing.
Diagnostic use case
Measure what visitors search for and which queries return results, surfacing demand and content gaps from real search behaviour.
What WebmasterID can help detect
WebmasterID can record search events first-party, so on-site demand is visible without third-party search scripts; queries can be aggregated rather than tied to individuals.
Common mistakes
- Storing raw search terms tied to a visitor identity.
- Ignoring zero-result queries that reveal content gaps.
- Double-counting with enhanced-measurement site search.
Privacy and accuracy notes
search_term can contain personal or sensitive input (names, health terms). Treat search queries as potentially sensitive and avoid storing them tied to identity. This is educational, not legal advice.
Related pages
- The site_search event (view_search_results)
The site_search event (view_search_results in GA4) records that a visitor searched within your site. It is a direct window into intent — the words people type tell you what they expect to find. But search terms can contain personal data, so this is also one of the most sensitive events: you record that a search happened and, carefully, the term, with the privacy caveats front of mind.
- Enhanced measurement (auto events)
Enhanced measurement is a GA4 setting that automatically collects a set of interaction events — scrolls, outbound clicks, site search, video engagement, file downloads, and form interactions — without extra code. It is convenient but not magic: it only covers standard patterns, can over- or under-count, and each option can be toggled. This page explains what it does and its limits.
- Event parameters: adding context safely
Event parameters are the key-value details attached to an event: which button, which product, which step. They are what turns a bare event name into something analysable. The craft is choosing a small, stable set of parameters with consistent names and values — and the discipline is keeping every one of them free of personal data, because parameters are stored and widely visible in tooling.
- Event Explorer
Inspect search queries in aggregate.
Sources and verification notes
Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.