Frontend Tools
Widgets & Plugins
Related Items
Let users discover more items based on what the crowd navigate to in the same session
Send Events using Insights
1aa('clickedObjectIDs', { 2 userToken: string, 3 index: string, 4 eventName: string, 5 objectIDs: array 6}); 7 8aa('convertedObjectIDs', { 9 userToken: string, 10 index: string, 11 eventName: string, 12 objectIDs: array 13});
Get Recommendations - API
1client.getRelatedProducts([ 2 { 3 indexName: 'your_index_name', 4 objectID: 'your_object_id', 5 }, 6]) 7.then(({ results }) => { 8 console.log(results); 9}) 10.catch(err => { 11 console.log(err); 12});
Display Recommendations - Front End
1<!--HTML--> 2<div class="relatedProducts"></div> 3 4// JavaScript 5function RelatedItem({ item }) { 6 return ( 7 <a href={item.url}> 8 <img src={item.image_link} alt={item.name} /> 9 <div>{item.category}</div> 10 <div>{item.name}</div> 11 <div>${item.price}</div> 12 </a> 13 ); 14} 15 16relatedProducts({ 17 container: '#relatedProducts', 18 recommendClient, 19 indexName, 20 objectIDs: [currentObjectID], 21 itemComponent: RelatedItem, 22});
Let users discover more items based on what the crowd navigate to in the same session
Let users discover more items based on what the crowd frequently bought together
This app shows how to leverage Algolia Personalization to display product recommendations in emails