- Shopify has two kinds of recommendations: related products, which Shopify generates, and complementary products, which you choose in the Search & Discovery app.
- Related products come from purchase history (bought together) and similar product descriptions, with shared collections as a fallback.
- Shopify links up to ten products to each product; sold-out items, $0 products, gift cards and items already in the cart are left out.
- You improve them with better product data, hand-picked complements and fewer junk collections, not with a setting for the algorithm.
- Measure them with click-through on the recommendation block, items per order and average order value, compared over the same period length.
Shopify's product recommendations are the "You may also like" and "Pairs well with" blocks a theme shows on product and cart pages. Shopify offers two kinds. Related products are generated automatically from what customers buy together and from how similar products are. Complementary products are the ones you choose yourself, in Shopify's free Search & Discovery app. Your theme asks Shopify for either list and shows it.
This guide explains what goes into each list, whether it is AI and whether it is personalised, how to add recommendations to a theme, how to make them better, when an app is worth it, and how to measure whether they earn anything.
What is Shopify's product recommendations algorithm?
It is the logic behind Shopify's Product Recommendations API, which themes call to get a list of products for a given product. You ask for one of two intents:
| Intent | What it shows | Who decides | Typical heading |
|---|---|---|---|
| related | Products similar to the one being viewed | Shopify, automatically | You may also like |
| complementary | Products that go with the one being viewed | You, in Search & Discovery | Pair it with |
How does Shopify generate related product recommendations?
According to Shopify's developer documentation, related products are predicted from three inputs:
The details that matter in practice:
- Shopify links up to ten related products to each product, ranked by relevance. Most themes show about four.
- Out-of-stock products, products priced at 0, gift cards and products already in the visitor's cart are left out.
- Orders imported from another store or platform are not used. A new store, or one that just migrated, starts with little purchase history, so descriptions and collections carry more weight at first.
- You cannot tell the algorithm to exclude a product. A theme can filter the returned list with code, and Search & Discovery can change the results.
How do complementary product recommendations work?
Complementary products are set by hand. In the Search & Discovery app you open a product and pick the items that go with it: the case for the phone, the refill for the bottle, the cleaner for the leather shoes. Your theme then shows them wherever it asks for the complementary intent. Because you choose them, they are only as good as your choices, and they need upkeep when products change.
Does Shopify use AI or machine learning for recommendations?
Related products are predicted from patterns in your data, which is a form of machine learning, and Shopify does not publish the exact method. Complementary products are not generated: you set them.
Does Shopify personalise recommendations for each visitor?
Shopify's documentation describes recommendations per product, not per visitor. The one visitor-specific rule it documents is that products already in the visitor's cart are left out. So two visitors looking at the same product will mostly see the same list. If you need recommendations based on each visitor's browsing in the session, that is where third-party apps come in.
Is Shopify Sidekick a recommendation engine?
No. Sidekick is an assistant for you, the merchant, in the Shopify admin. It can answer questions about your sales and help with tasks, but it does not choose which products shoppers see on the storefront. See Shopify's AI features.
How do you add product recommendations to a Shopify theme?
Most current themes have a product recommendations section built in: open the theme editor, go to a product template and add or enable the "Related products" or "Complementary products" block. For a custom theme, the pattern from Shopify's documentation is:
- Add a section with the recommendations object
In Liquid, check recommendations.performed? and loop over recommendations.products. The object is empty on the first page load.
- Load the section after the page
Give the section a data-url built from routes.product_recommendations_url, with the section id, the product id, a limit and the intent.
- Fetch it when it comes into view
A small script requests that URL when the section nears the screen and swaps in the returned HTML.
- Handle an empty list
Hide the section, or show a fallback, when no products come back.
{%- comment -%} The data-url the section fetches {%- endcomment -%}
<div class="product-recommendations"
data-url="{{ routes.product_recommendations_url }}?section_id={{ section.id }}&product_id={{ product.id }}&limit=4&intent=related">
</div>Use the product URLs the API returns, so Shopify's own analytics can count clicks on recommended products.
How do you improve Shopify's recommendation accuracy?
- Write real product descriptions. Similar descriptions are one of the inputs. Thin or copied supplier text makes unrelated products look alike.
- Clean up collections. Collections are the fallback. A "Sale" or "New" collection with everything in it creates weak matches. Make collections meaningful, such as by use or by product type.
- Set complements by hand. For products with obvious add-ons, choose them yourself instead of hoping the related list finds them.
- Keep stock accurate. Sold-out products are dropped, so wrong stock numbers remove good recommendations.
- Give it time. Purchase history grows with orders. A new store's recommendations get better as it sells.
- Use Search & Discovery. It lets you adjust results and set complements without code.
When should you use a third-party recommendation app instead?
- Your catalogue is small or medium
- Product pairings are obvious and you can set them
- You mainly need a block on the product page
- You want no extra monthly fee
- You want recommendations per visitor, based on the session
- You want to favour high-margin or overstocked products
- You need recommendations in the cart, checkout, post-purchase and email
- You want built-in testing of placements and rules
Apps in this space differ in focus: some cover the whole store and email, some focus on the cart and post-purchase moment, and some only add "frequently bought together" blocks. Compare current listings on the Shopify App Store, and see upsell apps for Shopify for the cart and post-purchase side.
How do you measure whether recommendations are working?
Recommendations should raise items per order and average order value without lowering conversion. Compare equal periods, or better, test with and without the block. An example with example numbers:
| Example store, 30 days | Without block | With block |
|---|---|---|
| Sessions | 40,000 | 40,000 |
| Orders | 1,000 | 1,010 |
| Items per order | 1.30 | 1.42 |
| Average order value | $58.00 | $62.50 |
| Revenue | $58,000 | $63,125 |
Watch three things: clicks on the recommendation block (Shopify's analytics can attribute them when the theme uses the returned URLs), items per order, and average order value. Then check profit: recommending low-margin add-ons can raise revenue and lower profit per order.
Measure recommendations in ROASaurus

ROASaurus measures the effect of recommendations with its own storefront events and your orders:
- Today › Dashboard compares units sold, AOV, add to carts, conversion rate and profit with the previous period.
- Profit › Products › Product conversion shows per product the viewers, adds to cart, cart rate, buy rate and revenue per viewer. A recommended add-on whose cart rate rises after you add the block is doing its job.
- Website › Visitors shows sessions, add-to-cart rate, conversion rate and revenue per session by source, device and landing page, so you can see whether a change helped every kind of visitor.
- Profit › Products shows margin and profit after ad spend per product, so you can check that the products you recommend are worth recommending.
Next step
Sources
- Shopify Dev Docs: Product recommendations
- Shopify Dev Docs: Show product recommendations (related products)
- Shopify App Store: Shopify Search & Discovery