Click and conversion events - Algolia

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.

Click and conversion events capture user interactions in your Algolia experience as structured data. Event data improves your analytics and ranking. Accurate click and conversion events help Algolia measure performance and optimize results. Events are also required for NeuralSearch, Recommend, Personalization, Dynamic Re-Ranking, Query Categorization, and revenue analytics. Without click and conversion events, these features can’t function. To see which event methods each feature uses, see Event types.

Focus on events after search or browse requests

The most important events to consider are those that occur after a search or browse request. For example:

To associate an event with a specific request, events must include a queryID parameter. Without queryID, Algolia can’t link the event to the originating search or browse request. For some conversion events, Algolia can infer the queryID from an earlier click event. For implementation details, see Keep track of query IDs. Events that include a queryID help Algolia determine if results were useful to users.

Basic events flow

  1. User searches or visits a category page (powered by Algolia)
  2. Your frontend sends a request to the Search API
    • The request includes these parameters:
      • userToken: to identify users (pseudonymously)
      • clickAnalytics: true: to return queryID
  3. Search API returns results
    • The response includes queryID, object IDs of the matching records, and positions.
  4. User clicks an item, adds it to the cart, or converts in another way
  5. Your frontend sends an event to the Insights API
    • Include at least these properties in search-related events:
      • userToken
      • queryID
      • objectIDs

For some conversion events, Algolia can infer the queryID automatically. For details, see Keep track of query IDs. Some event types need more properties. For more details, see also the Insights API reference.

Events that don’t follow a search or browse request still matter. Examples include clicks on product recommendations in an email. These signals help Recommend and Personalization.

Use one stable user identity

The userToken identifies a visitor or signed-in user. Keep it stable during a session. If your privacy model allows it, keep it stable across sessions too. A consistent user identity is essential for analytics and Personalization. You must send the same userToken with your search requests and events.

Before you send userToken, decide how Algolia should treat identity across sessions, devices, and login states:

Before you send events

Choose an implementation path

Now choose how you want to send events and validate them.