Analytics And Logging

Algolia

Algolia Analytics Events

Input:

The clickedObjectsAfterSearch method in the AlgoliaAnalyticsService class is used to track when users click on search results after performing a search. The input parameters are:

  • eventName (String): The name of the event, typically used to identify the type of user interaction (e.g., "Product Click").
  • indexName (String): The name of the Algolia index where the search was performed. This helps identify which dataset was used during the search.
  • queryId (String): The unique identifier for the search query. This ID is generated during the search operation and is necessary to associate the click event with the specific search.
  • objectIds (List): A list of object IDs representing the items that were clicked. These IDs correspond to the items in the search results.
  • positions (List?): (Optional) A list of positions where the clicked objects appeared in the search results.

Output:

This method returns a Future. The method sends the event data to Algolia Insights API to track the clicks on specific items after a search.

Process:

  1. Event Creation: The method prepares the event data, including the event name, index name, query ID, and object IDs.
  2. API Call: The method sends the prepared data to Algolia Insights API using the insights.clickedObjectsAfterSearch function.
  3. Tracking: This event helps track the effectiveness of search results, providing data on which items users are clicking on, thereby contributing to metrics like Click-Through Rate (CTR).

Input:

The convertedObjectsAfterSearch method tracks when users convert (e.g., make a purchase) after performing a search. The input parameters are:

  • eventName (String): The name of the conversion event (e.g., "Product Purchased").
  • indexName (String): The name of the Algolia index used during the search.
  • queryId (String): The unique identifier for the search query, essential for linking the conversion back to the original search.
  • objectIds (List): A list of object IDs representing the items that were converted (e.g., purchased).

Output:

This method returns a Future. It logs the conversion event to Algolia Insights API.

Process:

  1. Event Preparation: The method prepares the data for the conversion event, including the event name, index name, query ID, and object IDs.
  2. API Call: The method sends the conversion data to Algolia Insights API using insights.convertedObjectsAfterSearch.
  3. Metric Tracking: This method helps in tracking conversion rates by linking user actions back to the search queries that led to them.

3. Converted Objects

Input:

The convertedObjects method tracks conversions independently of a specific search query. The input parameters are:

  • eventName (String): The name of the conversion event (e.g., "Product Purchased").
  • indexName (String): The name of the Algolia index associated with the conversion.
  • objectIds (List): A list of object IDs representing the items that were converted (e.g., purchased).

Output:

This method returns a Future. The event data is sent to Algolia Insights API to track conversions.

Process:

  1. Event Creation: The method prepares the conversion event data, including the event name, index name, and object IDs.
  2. API Call: The conversion event is sent to Algolia Insights API using insights.convertedObjects.
  3. Tracking and Analysis: This method is useful for tracking conversions that may not be directly tied to a search query but still involve items indexed in Algolia.

Copyright © 2026