Algolia is one of the leading providers of search and recommendation solutions, with a significant market share in the industry. So considering using Algolia to power your website’s search & recommendations is a no brainer.
Why use AI recommendations ?
AI recommendation models are trained on user interactions or clicks to recommend the most relevant products or items for each user.
You can usually find them in e-commerce websites, at the bottom of products detailed view or in the homepage. But they can also be found on streaming websites (movie and music) or services, news and many other industries.
Algolia AI recommendations in Gymshark
Recommendations are useful since they can increase user engagement and drive conversions. Since users are continously served the content or items they want to see, they aremore engaged with your platform, spending more time exploring and interacting with recommended content. Additionally, by presenting users with personalized suggestions that align with their interests and preferences, recommendations can effectively guide them towards making a purchase or taking a desired action, ultimately driving conversions and maximizing revenue.
Algolia recommendations features
Algolia offers multiple recommendation models for all purposes. They are based on content-based and collaborative filtering algorithms.
Recommendation types (models)
Related products
The “related products” recommendations can be used to recommend items or products similar to the ones the visitor is currently viewing or has viewed in the past. This will offer the visitor a more diverse catalogue since they can browse countless other similar items that could interest them.
Frequently bought together
The “frequently bought together” recommendations will, as it’s name suggests, recommend items that are not similar but could complement eachother and are frequently bought together.
This means that when viewing a hat, this recommendation will probably suggest sunglasses, sunscreen and shorts.
Trending items
Algolia AI recommendations (trending) in Gymshark
The “trending” recommendations will recommend the most popular items to the users. This can be displayed on our homepage so that your users can know where to start.
Looking similar
Recommend visually similar items using this top of the line AI recommendation. The AI model will recognize items or products that have similar looking feaured images and recommend the relevant ones.
Trending facet (filters) recommendations
The trending facets recommendations will recommend facets that have recently gained popularity.
Recommend rules
You can further customize your recommendations without having to modify your code using the recommend rules that are applied in the Algolia backend.
The rule in the example above will only display items for which the price is greater than 10.
This is offers the users total freedom. The screenshot above shows a rule created visually in the Algolia dashboard but you could also create them using JSON.
Algolia UI recommendations libraries (Javascript & React)
Algolia offers React & Javascript UI libraries to easily display your recommendations to your visitors in the frontend. Algolia provides an example script so you can instantly set up your recommendations :
/** @jsx h */
import { h } from 'preact';
import {
frequentlyBoughtTogether,
relatedProducts,
} from '@algolia/recommend-js';
import recommend from '@algolia/recommend';
const recommendClient = recommend('YourApplicationID', 'YourSearchOnlyAPIKey');
const indexName = 'YOUR_INDEX_NAME';
const currentObjectID = 'YOUR_OBJECT_ID';
frequentlyBoughtTogether({
container: '#frequentlyBoughtTogether',
recommendClient,
indexName,
objectIDs: [currentObjectID],
itemComponent({ item }) {
return (
<pre>
<code>{JSON.stringify(item)}</code>
</pre>
);
},
});
relatedProducts({
container: '#relatedProducts',
recommendClient,
indexName,
objectIDs: [currentObjectID],
itemComponent({ item }) {
return (
<pre>
<code>{JSON.stringify(item)}</code>
</pre>
);
},
});
Collect user events
Events are actions that users take on the website. They are used for all types of personalization since they allow the AI models to learn more about each one of the users. This means that as user engagement increases on the website, the accuracy of recommendations also improves.


Algolia provides many user events for you to collect :
- clickedObjectIDsAfterSearch
- convertedObjectIDsAfterSearch
- addedToCartObjectIDsAfterSearch
- purchasedObjectIDsAfterSearch
- clickedObjectIDs
- convertedObjectIDs
- addedToCartObjectIDs
- purchasedObjectIDs