Event types
Learn about the different events you can collect with the Algolia Insights API and the features they unlock.
The Algolia Insights API accepts three types of events: click, conversion, and view events. By sending events, you can enable one or more Algolia features.
To get started with your implementation, see Get started with click and conversion events.
Events by features
The following table lists events and where they’re used.
NeuralSearch, Dynamic Re-Ranking, Query Categorization, Search analytics, Revenue analytics, A/B testing | Recommend | Personalization | |
---|---|---|---|
clickedObjectIDsAfterSearch | |||
convertedObjectIDsAfterSearch | |||
addedToCartObjectIDsAfterSearch | |||
purchasedObjectIDsAfterSearch | |||
clickedObjectIDs | |||
convertedObjectIDs | |||
addedToCartObjectIDs | |||
purchasedObjectIDs | |||
clickedFilters | |||
convertedFilters | |||
viewedObjectIDs | |||
viewedFilters |
To learn more about the properties of each event, see the Insights API reference.
Minimum number of events
In general, the features that require events work better with more events. Some features need a minimum number of events to be active.
Events requirements for NeuralSearch
- Minimum 1,000 click OR 100 conversion events within 30 days.
NeuralSearch uses these events:
- clickedObjectIDsAfterSearch (click)
- convertedObjectIDsAfterSearch (conversion)
- addedToCartObjectIDsAfterSearch (conversion)
- purchasedObjectIDsAfterSearch (conversion)
Events requirements for Recommend—Frequently Bought Together
- Minimum 1,000 conversion events with 2 or more products within 30 days
- Maximum 3,000,000 conversion events within 30 days
If there aren’t enough events within 30 days, the collection period extends to 90 days.
Frequently Bought Together uses these events:
- convertedObjectIDsAfterSearch
- convertedObjectIDs
- addedToCartObjectIDsAfterSearch
- addedToCartObjectIDs
- purchasedObjectIDsAfterSearch
- purchasedObjectIDs
Events requirements for Recommend—Related Products
- Minimum 10,000 events within 30 days
- Maximum 3,000,000 events within 30 days
If there aren’t enough events within 30 days, the collection period extends to 90 days.
Related Products uses these events:
- clickedObjectIDsAfterSearch
- clickedObjectIDs
- convertedObjectIDsAfterSearch
- convertedObjectIDs
- addedToCartObjectIDsAfterSearch
- addedToCartObjectIDs
- purchasedObjectIDsAfterSearch
- purchasedObjectIDs
Events requirements for Recommend—Related Content
- Minimum 10 events on items with content-based attributes within 30 days
- Maximum 1,500,000 events within 30 days
If there aren’t enough events within 30 days, the collection period extends to 90 days.
Related Content uses the same events as the Related Products model.
Events requirements for Recommend—Trending Items and Trending Facet Values
- Minimum 500 conversion events within 30 days
- Maximum 3,000,000 conversion events.
Trending Items and Trending Facet Values use these events:
- convertedObjectIDsAfterSearch
- convertedObjectIDs
- addedToCartObjectIDsAfterSearch
- addedToCartObjectIDs
- purchasedObjectIDsAfterSearch
- purchasedObjectIDs
Events requirements for Dynamic Re-Ranking
- Minimum 20 click events OR 2 conversion events within 30 days
Records with fewer events won’t be re-ranked.
Dynamic Re-Ranking uses these events:
- clickedObjectIDsAfterSearch (click)
- convertedObjectIDsAfterSearch (conversion)
- addedToCartObjectIDsAfterSearch (conversion)
- purchasedObjectIDsAfterSearch (conversion)
To prevent a manipulation of your ranking,
Dynamic Re-Ranking only considers 1 event per user (userToken
) per search query per record (objectID
).
Events requirements for Query Categorization
Query Categorization needs a minimum number of events to train the model for predicting categories. It always uses events from the last 90 days.
Query Categorization uses these events:
- clickedObjectIDsAfterSearch
- convertedObjectIDsAfterSearch
- addedToCartObjectIDsAfterSearch
- purchasedObjectIDsAfterSearch
Events on category pages
You can build category pages with Algolia by sending a request with an empty search query and an applied filter.
Because category pages are just a different form of search requests, you’ll use the same events for category pages and search results.
Events related and unrelated to Algolia requests
Some events come in two variants: with and without a query ID.
Events with a query ID have AfterSearch
in their name.
Most Algolia features use events with query IDs, for example, to calculate the conversion rate of your search.
What is the query ID?
The queryID
is a random sequence of letters and numbers that uniquely identifies a search request.
Algolia uses the query ID to connect a search or browse request to a click or conversion event.
Use the events debugger to check which search API request corresponds to which event.
Algolia generates the query ID and includes it in the API response if you set clickAnalytics
to true
when making the search request.
Since conversions often occur outside Algolia-driven experiences—for example, from the shopping cart, you need to keep track of the query ID on your site.
Events related to Algolia requests
To track events after a previous Algolia search or browse request,
set the clickAnalytics
parameter to true
and
use the clickedObjectIDsAfterSearch
or convertedObjectIDsAfterSearch
methods.
Examples include:
- A user searches and clicks a search result to visit a detail page.
You can track this by sending a
clickedObjectIDsAfterSearch
event. - A user converts on a category page you built with Algolia.
You can track this by sending a
convertedObjectIDsAfterSearch
event.
queryID
are time-sensitive. They must occur within one hour of the corresponding search request.Events unrelated to Algolia requests
To track events that are unrelated to a previous Algolia search or browse request,
use the clickedObjectIDs
and convertedObjectIDs
methods.
Examples include:
-
You’re not using Algolia to build your category pages. Use
clickedObjectIDs
to track clicks andconvertedObjectIDs
to track conversions. -
You’re sending emails with recommendations. When users click a recommendation and buy an item, track the conversion with
convertedObjectIDs
. -
In a buy-online, pick-up in-store scenario, the conversion finishes hours or days after the initial search or browse request. Use
convertedObjectIDs
to track the conversion.
Was this page helpful?