Track On-Site Search
Track on-site search in Hardal with a custom event, verify search context, and analyze ordered conversion journeys.
Use a custom search event to understand how often visitors use on-site search and whether a defined journey continues to a product or outcome. Automatic page views do not necessarily describe searches that update results without navigation.
Define the successful interaction
Send an event when your application has produced search results, rather than on every keystroke. Choose one stable custom name and keep it consistent:
hrd.track("site_search", {
results_count: 12,
search_surface: "header"
});
Call this after the tracker is available. Replace the example count with the result count from your application. A zero-result search is still a completed search; send results_count: 0 when that is what occurred.
Keep raw queries out of the example event unless you have reviewed their sensitivity and your collection policy. Search boxes can receive personal or confidential text. The result count and search surface can provide useful context without collecting the query itself.
Check the event and journey
Use Engagement → Events to inspect site_search, its parameters, and the related session. Parameters are available as event context; this example does not create an automatic query-ranking or zero-result dashboard.
Create a funnel such as site_search → view_item → purchase when those events are implemented. It measures visits following that event order, not whether the same search result caused a specific purchase.
Connect the finding to product work
Use the event volume to understand search usage and inspect sample timelines for the experience. A repeated search without the expected next step can justify reviewing results or tracking, but event totals alone do not establish search relevance.
Read Plan Your Events before adding custom activity, and Analyze Product Views, Carts, and Purchases for the Commerce view.