Skip to main content
Recommend analytics uses the same Insights API and event model as Search analytics. For the concepts behind event tracking, see Click and conversion events. To choose an implementation path, see Choose how to send events. This guide explains the Recommend-specific parameters to add to your requests so Algolia can assign click and conversion events to recommendations.

Get started with Recommend analytics

To use Recommend analytics, include the parameters that link recommendation results to click and conversion events in your Recommend requests.

Enable events collection

Set the clickAnalytics parameter to true when making Recommend requests. This adds the queryID parameter to the Recommend response, which you need to link events to recommendations.
JavaScript
const response = await client.getRecommendations({
  requests: [
    {
      // All models except `trending-facets` are supported.
      model: "related-products",
      indexName: "indexName",
      objectID: "objectID",
      threshold: 0,
      queryParameters: {
        clickAnalytics: true, 
      },
    },
  ],
});

// Use this queryID when sending click and conversion events for these recommendations
const queryID = response.results[0].queryID;
For more information, see Keep track of query IDs.

Send user tokens

User tokens are strings that uniquely identify users in your app. They link click and conversion events to user profiles. For more information, see User token.
JavaScript
const response = await client.getRecommendations({
  requests: [
    {
      model: "related-products",
      indexName: "indexName",
      objectID: "objectID",
      threshold: 0,
      queryParameters: {
        clickAnalytics: true,
        userToken: "user-1234", 
      },
    },
  ],
});

Add analytics tags (optional)

You can use analytics tags to create different suggestions for different environments, such as mobile or desktop users, or for different geographical regions.
JavaScript
const response = await client.getRecommendations({
  requests: [
    {
      model: "related-products",
      indexName: "indexName",
      objectID: "objectID",
      threshold: 0,
      queryParameters: {
        clickAnalytics: true,
        analyticsTags: ["front_end", "website2"], 
      },
    },
  ],
});
You can use clickAnalytics, userToken and analyticsTags parameters with all API clients and UI libraries. Pass these parameters in the Recommend request.

Send click and conversion events

After you enable clickAnalytics and send a userToken with your Recommend requests, use the standard event flow to send click and conversion events.
Last modified on April 20, 2026