Skip to content

Enable Algolia click analytics (clickAnalytics + queryID propagation) #486

Description

@zigzagdev

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

  • clickAnalytics: true is sent with every Algolia search request.
  • queryID and each hit's objectID are available in the /api/v1/heritages/search response.
  • Confirmed in the Algolia dashboard that click events start appearing once the frontend half is wired up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions