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.
What this means
GA4 enhanced measurement detects site search by looking for common query parameters in the URL (such as q, s, search, query, keyword) and fires a view_search_results event with the search term. It turns your internal search box into an analytics source revealing what visitors expect your site to contain.
Intent value and sensitivity
Site search is high-signal: repeated searches for something you already publish means people cannot find it (a navigation problem); searches for something you do not have is a content gap. The catch is sensitivity — people type anything into a search box, including personal data. Decide deliberately whether to store the raw term, and review the parameters being matched.
- Detected from common query parameters in the URL
- Reveals content gaps and navigation problems
- Search terms can carry personal data — treat as sensitive
How it appears in analytics and logs
A view_search_results event means an on-site search ran. Frequent searches for content you already have points to navigation problems; searches for missing content reveal gaps.
Diagnostic use case
Learn what visitors look for on your site to surface content gaps and navigation problems, while treating raw search terms as sensitive data.
What WebmasterID can help detect
WebmasterID can record that a search occurred as a first-party event while leaving sensitive raw terms out by default, so intent signals do not become a data-protection risk.
Common mistakes
- Storing raw search terms without considering personal data.
- Missing searches because the query parameter is non-standard.
- Treating search volume as content quality rather than findability.
Privacy and accuracy notes
Search terms can contain names, emails, or other personal data that visitors type. Treat the search-term parameter as sensitive, and consider disabling capture where queries are likely personal. This is educational, not legal advice.
Related pages
- 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.
- Custom events: tracking what matters to you
Custom events capture meaningful actions a pageview cannot — a CTA click, a signup, a video play, a form submit. The value is in a consistent naming taxonomy and well-chosen properties. The risk is putting personal data into event names or properties, which turns analytics into surveillance. This page covers both.
- GDPR and web analytics: the practical picture
The GDPR governs processing of personal data of people in the EU. For analytics that means: identifiers and IP addresses can be personal data, consent is often required for cookie-based tracking, and minimisation matters. Cookieless, first-party, anonymised measurement reduces the surface — but this is a factual overview, not legal advice.
- Privacy-first analytics
Measure intent without storing sensitive terms.
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.