Instrument Algolia click events in docs search
mary
Opened Jun 22, 2026
Updated Jun 24, 2026
Wire up Algolia events from the docs search box so we can see what people search and which results they actually open.
What changed
Enabled DocSearch's insights: true option in docs/docusaurus.config.ts. With @docsearch/react v4, this makes the search box automatically send click and conversion events to Algolia (handling queryID/userToken plumbing for us).
Why
Search-query analytics were already flowing automatically (DocSearch runs searches through the Algolia API). The gap was click events — which result wins for a given query. Enabling insights lights up Click Analytics (CTR, click position) on the Miren Docs index alongside the existing search-query data.
Notes
- Algolia's dashboard "automatic event collection" toggle is a separate no-code path that requires InstantSearch/Autocomplete on the page; DocSearch isn't detected by it (expected warning). Our events are sent programmatically via
insights: true, so that toggle should stay off. - Verify after deploy: search + click a result, then check Data sources → Events → Debugger for incoming
clickedevents.
Commit: 8eb7d0a3 on branch add-algolia-events.