Search by Algolia
How to increase your ecommerce conversion rate in 2024
e-commerce

How to increase your ecommerce conversion rate in 2024

2%. That’s the average conversion rate for an online store. Unless you’re performing at Amazon’s promoted products ...

Vincent Caruana

Senior Digital Marketing Manager, SEO

How does a vector database work? A quick tutorial
ai

How does a vector database work? A quick tutorial

What’s a vector database? And how different is it than a regular-old traditional relational database? If you’re ...

Catherine Dee

Search and Discovery writer

Removing outliers for A/B search tests
engineering

Removing outliers for A/B search tests

How do you measure the success of a new feature? How do you test the impact? There are different ways ...

Christopher Hawke

Senior Software Engineer

Easily integrate Algolia into native apps with FlutterFlow
engineering

Easily integrate Algolia into native apps with FlutterFlow

Algolia's advanced search capabilities pair seamlessly with iOS or Android Apps when using FlutterFlow. App development and search design ...

Chuck Meyer

Sr. Developer Relations Engineer

Algolia's search propels 1,000s of retailers to Black Friday success
e-commerce

Algolia's search propels 1,000s of retailers to Black Friday success

In the midst of the Black Friday shopping frenzy, Algolia soared to new heights, setting new records and delivering an ...

Bernadette Nixon

Chief Executive Officer and Board Member at Algolia

Generative AI’s impact on the ecommerce industry
ai

Generative AI’s impact on the ecommerce industry

When was your last online shopping trip, and how did it go? For consumers, it’s becoming arguably tougher to ...

Vincent Caruana

Senior Digital Marketing Manager, SEO

What’s the average ecommerce conversion rate and how does yours compare?
e-commerce

What’s the average ecommerce conversion rate and how does yours compare?

Have you put your blood, sweat, and tears into perfecting your online store, only to see your conversion rates stuck ...

Vincent Caruana

Senior Digital Marketing Manager, SEO

What are AI chatbots, how do they work, and how have they impacted ecommerce?
ai

What are AI chatbots, how do they work, and how have they impacted ecommerce?

“Hello, how can I help you today?”  This has to be the most tired, but nevertheless tried-and-true ...

Catherine Dee

Search and Discovery writer

Algolia named a leader in IDC MarketScape
algolia

Algolia named a leader in IDC MarketScape

We are proud to announce that Algolia was named a leader in the IDC Marketscape in the Worldwide General-Purpose ...

John Stewart

VP Corporate Marketing

Mastering the channel shift: How leading distributors provide excellent online buying experiences
e-commerce

Mastering the channel shift: How leading distributors provide excellent online buying experiences

Twice a year, B2B Online brings together America’s leading manufacturers and distributors to uncover learnings and industry trends. This ...

Jack Moberger

Director, Sales Enablement & B2B Practice Leader

Large language models (LLMs) vs generative AI: what’s the difference?
ai

Large language models (LLMs) vs generative AI: what’s the difference?

Generative AI and large language models (LLMs). These two cutting-edge AI technologies sound like totally different, incomparable things. One ...

Catherine Dee

Search and Discovery writer

What is generative AI and how does it work?
ai

What is generative AI and how does it work?

ChatGPT, Bing, Bard, YouChat, DALL-E, Jasper…chances are good you’re leveraging some version of generative artificial intelligence on ...

Catherine Dee

Search and Discovery writer

Feature Spotlight: Query Suggestions
product

Feature Spotlight: Query Suggestions

Your users are spoiled. They’re used to Google’s refined and convenient search interface, so they have high expectations ...

Jaden Baptista

Technical Writer

What does it take to build and train a large language model? An introduction
ai

What does it take to build and train a large language model? An introduction

Imagine if, as your final exam for a computer science class, you had to create a real-world large language ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

The pros and cons of AI language models
ai

The pros and cons of AI language models

What do you think of the OpenAI ChatGPT app and AI language models? There’s lots going on: GPT-3 ...

Catherine Dee

Search and Discovery writer

How AI is transforming merchandising from reactive to proactive
e-commerce

How AI is transforming merchandising from reactive to proactive

In the fast-paced and dynamic realm of digital merchandising, being reactive to customer trends has been the norm. In ...

Lorna Rivera

Staff User Researcher

Top examples of some of the best large language models out there
ai

Top examples of some of the best large language models out there

You’re at a dinner party when the conversation takes a computer-science-y turn. Have you tried ChatGPT? What ...

Vincent Caruana

Sr. SEO Web Digital Marketing Manager

What are large language models?
ai

What are large language models?

It’s the era of Big Data, and super-sized language models are the latest stars. When it comes to ...

Catherine Dee

Search and Discovery writer

Looking for something?

facebookfacebooklinkedinlinkedintwittertwittermailmail

As the popularity of ecommerce and digital media explodes, the tools most online companies use to make recommendations have not meaningfully changed – until recently. The early recommendation tools, around since the earliest digital marketplaces, based their recommendations on heuristic-based filters, breaking down items into categories and tracking co-occurrence in users’ carts or watch lists. 

While filtering-based recommendations (as discussed below) are simple to implement and don’t necessarily rely on complex algorithms, they have their limitations. Modern solutions based on machine learning offer a significant improvement.

Amazon is at the forefront of AI-powered recommender systems – recommendations account for 35% of their sales. Their algorithms are carefully guarded, very well-trained – and expensive, but it’s possible to get great results with much less investment. The same goes for Netlify and Spotify.

Recommendation engines can be built around a variety of models. Depending on your products and target consumers, different algorithms will be used according to your needs. Two of the most widely-used models will be very familiar to anyone who shops on Amazon. “Related Items” and “those-who-bought-this-also-bought” recommendations are both collaborative filtering algorithms, and there are a range of options for implementing them. 

In this post, we’ll cover a few different approaches to recommendations tools. You can use classic methods, based on tagging and filtering. Alternatively, we’ll show how machine learning (ML) and artificial intelligence (AI) can provide privacy-safe and more natural recommendations. Lastly, you’ll see how Algolia Recommend approaches these problems to provide developers an API-level recommendation engine. But first, it’s important to understand the user’s context and how they’ll see your recommendations.

Make high-quality recommendations part of the search journey

Potential customers generally enter a site with one of two approaches. They may know, with specific guidelines, exactly what they are looking for – a high-quality child’s bike helmet, a white blouse in natural fibers, a brown leather ottoman. Or they may be browsing generally, looking for a gift for a milestone birthday or better solutions for a home office. 

In either case, recommendations have the potential to connect potential buyers with products they might not have found on their own by identifying patterns in user behavior. Below, we’ll look at two possible approaches – a simple filter-based approach, and an ML-based solution.

Get custom results with simple tags with no AI

Among dozens of white blouses, a user clicks on one that is tunic-length linen. Without using any AI, you can make recommendations by using tags and sales history. 

Perhaps that blouse has been tagged as “casual” in style and is part of your Spring editorial campaign. You could easily return a short list of three or four other blouses that meet at least two criteria—casual style, spring season, linen, white, tunic-length, price point. 

Preparing your data to provide this type of recommendation requires some up-front work and ongoing validation to ensure all products in your inventory are indexed correctly. For each item, you must decide what properties you want to “match” on, and the relative importance of each matching property. When a new product is added to your catalog, it will need to be ‘tagged’ and assigned matching properties that might not be easy to upload automatically. A blouse’s color may populate automatically, but ‘style’ or ‘season’ may not. It’s possible to get precise, quality recommendations using this approach, particularly if your inventory does not change too often. 

Another non-AI approach is to use sales history. It’s a reasonable assumption that customers who have one purchase in common might have others in common, as well. Sales history could feed recommendations for other items purchased by people who bought the selected item. The query to find these product-buyer-product relationships will likely use more resources than the product-product relationship above, so it may be inefficient for large inventories. For companies with many categories of products, it may also result in some unwanted ‘noise’ in the recommendations (for example, that best-selling item shows up because it’s generally popular, not because it’s related to other products). In addition, when a new product is added to your catalog, there will be no purchase history to draw on. 

An additional drawback of the sales history approach is that it introduces consumer data directly into your matching algorithm. It’s certainly possible to do this in a fully secure and private way, but any time customer data is used in public-facing code, there is a greater risk of exposing private data. Avoiding data leaks is a commitment that takes time and knowledge. 

Depending on your situation, these downsides can be substantial. While good recommendations don’t require AI, you may be able to avoid handling user data and brute-forcing fine-tuned recommendations. Let’s look at what it looks like to dip into an ML-based approach.

Use ML-based AI solutions for better recommendations

The trouble with filter-based, non-AI recommendations is that they assume users know what they want and can describe it accurately. Sometimes that is the case. But often, the most effective recommendations are for items the user might not have sought out or uncovered on their own.

The major advantage of ML-based recommendations is to help with the problem of discovery. Shoppers for kids’ bike helmets likely have other needs in common—children’s safety equipment, and potentially outdoor activities, healthy eating, or alternative commutes, or other interests that are even more difficult to predict. 

Rather than trying to anticipate all of these connections, an AI algorithm notices patterns in shopper behavior that could be difficult to predict or describe. The recommendations an ML-based solution provides have an element of serendipity and ‘fit’ that helps them stand out. To begin observing these patterns, you start by collecting user events. However, as with personalization mentioned earlier, it’s important that you don’t expose private data.

Capture user events for high quality results with low privacy risk

The richest data available to ML-based recommendation engines is user events like clicks and conversions. Historically, recommendations have only reflected users’ current action – the most recent item clicked, the current search term. Search for a white blouse, and you will get white blouses. Tracking the sequence of user actions provides richer insight into a specific user’s goals and interests than a single event. A clickstream that goes from white blouses to pastel dresses and on to sandals provides much greater insight into a shopper’s interests than just the initial search term.

This sort of user data tracking can introduce unwanted privacy risks into your application. A fortunate upside of AI solutions is that they are a win for user privacy and data security, as well as providing better recommendations. They learn based on the past behavior of many, then make predictions according to a model.

ML-based solutions are tuned specifically to the way customers interact with your products and services during a given session. The specific search terms, clicks, and conversions from a user’s current visit to your site help you make recommendations tailored to what they are looking for at that moment. 

Collecting event data enables more than just recommendations. Tracking user view, click, and conversion events can tell you a great deal about how users are interacting with your site and products. You’ll want to categorize and store the event data, training your model with linear regression and other ML-based algorithms.

If you choose to use Algolia, its Insights API will be your hub for collecting and sending user event data to your Application. You can use that data for A/B testing and dynamic product re-ranking that responds to users’ choices, and to offer more tailored recommendations.

The code below shows a simple example of how data gets sent to Insights. An onClick event handler in your front end makes a simple POST request (shown here as you might emulate the event from cURL):

curl -X POST \
https://insights.algolia.io/1/events \
-H 'x-algolia-api-key: ${ADMIN_API_KEY}' \
-H 'x-algolia-application-id: ${APPLICATION_ID}' \
-H "Content-Type: application/json" \
-d '{
    "events": [
        {
          "eventType": "click",
          "eventName": "Product Clicked",
          "index": "products",
          "userToken": "user-123456",
          "timestamp": 1529055974,
          "objectIDs": ["9780545139700", "9780439784542"],
          "queryID": "43b15df305339e827f0ac0bdc5ebcaa7",
          "positions": [7, 6]
        },
      ]
    }'

A queryID ties the click event to a specific Algolia search, and is only valid within one hour of the search. A session-based token connects the click event to a user. There is little risk of exposing sensitive user data, because it simply isn’t collected. Meanwhile, the user can get recommendations that are responsive to their actions in the moment.

Use collaborative filtering to generate precise recommendations

The most common “frequently bought together” suggestions start with collaborative filtering algorithms. The basic goal for any recommendation AI is to find similarities between users and products, and make suggestions based on those similarities. Collaborative filtering algorithms are widely used in data science to make predictions about how a user will rate a product, based on how other users with similar preferences have rated that product. Many explanations of collaborative filtering use movies as an example. A simplified scenario:

  • I love period dramas, and have given high ratings to TV shows like The Crown and Call The Midwife.
  • I really dislike TV shows with too much fantasy, and have given low ratings to Sherlock and Dr. Who. My sister loves them!
  • Pat and Sam also both love period dramas, and have rated The Crown very highly too.
  • Pat also enjoys fantasy-based shows, and gave high ratings to those shows I disliked.
  • Sam is more similar to me, so he rates fantasy TV shows lower.
  • A new show is released that is categorized as mystery/crime, but which has both historical and fantasy elements. Pat rates it highly, Sam rates it lower.
  • None of us have ever rated a mystery/crime show before this.
  • Because my preferences match Sam’s in general, this show is not recommended for me. My sister’s preferences match Pat’s, and she gets the new show in her recommendation queue!

At scale, a collaborative filtering algorithm is more complex than this, though the basic principles are very similar. Scalability is a selling point for ML-based recommendation systems, unlike the non-AI solutions we discussed above. The larger the dataset, the more compelling the case is for using an AI algorithm, because there is more opportunity to find patterns in user behavior. Amazon relies heavily on collaborative filtering, leading to product recommendations that can feel serendipitous and uniquely personalized. 

Collaborative filtering algorithms fall into a few categories – user-based, item-based, hybrid, and matrix factorization. Even among hybrid systems, there are a range of options for how many approaches to combine and in what priority order. Each is best-suited for different types of data sets, depending on the number of users, type of items, density of ratings per user, and item categories. 

Use Algolia recommend to get an ML-based solution that’s always improving

While there is no single recommendation solution that makes sense for every purpose, in most cases, a very good option does not have to be a complicated one. For ecommerce companies, a collaborative filtering approach is still likely the best choice. 

Algolia Recommend delivers high-performance AI-powered recommendations in an API. The API form factor means it is fast to implement, particularly because of the simple front-end UI code snippets. It is also a way to ensure that your recommendations will be better over time. Those iterative improvements delivered through the API will automatically come through – no recoding on your part.

If you don’t have an Algolia Index, create an account and app. Implementing Algolia Recommend, standalone or with Algolia Search, will be an easy step towards getting the best results out of your ecommerce site. You can see it in action in two videos, or learn more from our in-depth guide. If you’re not familiar with Algolia, these resources can help deepen your understanding of Recommendation engines in general and give you a sense of how easy it is to work with Algolia.

About the author
Julia Seidman

Developer Educator

linkedin

Recommended Articles

Powered byAlgolia Algolia Recommend

What are personalized recommendations and how can they boost engagement and conversion?
ux

Catherine Dee

Search and Discovery writer

What is a product recommender (or product recommendation engine)?
product

Catherine Dee

Search and Discovery writer

What is a recommender system (or recommendation engine)?
product

Catherine Dee

Search and Discovery writer