PureStats documentation

Internal Site Search Analytics

Measure privacy-screened search terms, zero-result searches, result clicks and conversions in PureStats.

PureStats can show what visitors search for on your website, which searches return no results, which results visitors select and whether a search session later converts.

Enable Site Settings → Site search first. Explicit tracking is recommended because it lets your application provide an accurate result count:

purestats.trackSiteSearch('analytics dashboard', 12)
purestats.trackSiteSearchClick('analytics dashboard', '/features/analytics')

The optional pf-search.min.js module is loaded from the same origin as the main tracker. Existing snippets do not need additional attributes.

URL detection

Automatic URL detection is disabled by default. When enabled, PureStats reads only the query parameters configured for the site, such as q, query, search or s. Do not enable it when search URLs can contain names, email addresses or other personal information.

Privacy safeguards

Search terms are limited to 200 characters and screened for email addresses, phone numbers and IP addresses before storage. Queries containing only sensitive data are discarded. Site search follows the site's consent mode, Do Not Track preference, excluded paths and traffic classification.

Search activity is available in Analytics → More → Site Search, CSV exports, visitor journeys and the Stats API at GET /api/stats/site-search.

Enabling Site Search also creates the event-scoped Site search term custom dimension. This makes the screened search_query value available to segments, funnels, Explore reports and other custom-dimension filters without storing a second unscreened value.