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
1$insights = Algolia\AlgoliaSearch\InsightsClient::create('YourApplicationID', 'YourSearchOnlyAPIKey'); 2 3// send click events 4$insights->user("userToken")->clickedObjectIDs( 5 'your_event_name', 6 'your_index_name', 7 ['objectID1', 'objectID2'] 8); 9// send conversion events 10$insights->user("user-1")->convertedObjectIDs( 11 'your_event_name', 12 'your_index_name', 13 ['objectID1', 'objectID2'] 14);
Get Recommendations - API
1$recommendations = $recommendClient->getRelatedProducts([ 2 [ 3 'indexName' => 'your_index_name', 4 'objectID' => 'your_object_id', 5 ], 6]);
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