Description
The Algolia dashboard's Analytics tab currently shows "No tracked searches" for Click-through Rate, Conversion Rate, and No Clicks Rate — meaning click events are not being sent to Algolia at all. Search volume is too low/synthetic right now to judge whether specific search behaviors (e.g. typo tolerance interacting with facet filters) are real problems, because there's no way to measure whether returned results are actually useful to users.
AlgoliaWorldHeritageSearchAdapter::search() calls searchSingleIndex() without clickAnalytics, so Algolia never generates a queryID for the request, and nothing is returned to the frontend to attach to a later click event.
Changes needed (backend)
- Pass
clickAnalytics: true in the searchSingleIndex() call in AlgoliaWorldHeritageSearchAdapter::search().
- Read the
queryID from the Algolia response and include it in HeritageSearchResult / the search API response, alongside each result's Algolia objectID (currently only the numeric id is surfaced — objectID needs to be available too, since Algolia Insights events are keyed by objectID, not necessarily the same value).
Why this matters
Without this, any future Algolia Rules/ranking tuning (e.g. region facet vs. typo tolerance trade-offs) is based on guesswork rather than real usage data (CTR, conversion, no-clicks rate).
Frontend follow-up tracked in zigzagdev/world-heritage-frontend (sending the actual click events via search-insights).
Acceptance Criteria
Description
The Algolia dashboard's Analytics tab currently shows "No tracked searches" for Click-through Rate, Conversion Rate, and No Clicks Rate — meaning click events are not being sent to Algolia at all. Search volume is too low/synthetic right now to judge whether specific search behaviors (e.g. typo tolerance interacting with facet filters) are real problems, because there's no way to measure whether returned results are actually useful to users.
AlgoliaWorldHeritageSearchAdapter::search()callssearchSingleIndex()withoutclickAnalytics, so Algolia never generates aqueryIDfor the request, and nothing is returned to the frontend to attach to a later click event.Changes needed (backend)
clickAnalytics: truein thesearchSingleIndex()call inAlgoliaWorldHeritageSearchAdapter::search().queryIDfrom the Algolia response and include it inHeritageSearchResult/ the search API response, alongside each result's AlgoliaobjectID(currently only the numericidis surfaced —objectIDneeds to be available too, since Algolia Insights events are keyed byobjectID, not necessarily the same value).Why this matters
Without this, any future Algolia Rules/ranking tuning (e.g. region facet vs. typo tolerance trade-offs) is based on guesswork rather than real usage data (CTR, conversion, no-clicks rate).
Frontend follow-up tracked in zigzagdev/world-heritage-frontend (sending the actual click events via
search-insights).Acceptance Criteria
clickAnalytics: trueis sent with every Algolia search request.queryIDand each hit'sobjectIDare available in the/api/v1/heritages/searchresponse.