1. Home
  2. Blog
  3. E-Commerce

E-Commerce

How to Build an Ecommerce Product Recommendation Engine: Bought Together, Similar Items, Lift, Filters and Measurement Guide

Product recommendation engine guide: bought-together and lift math, similar items, cold start, filters, placement and control-group measurement, with examples.

Contents 13 sections
  1. What Is a Product Recommendation Engine and What Is It For?
  2. Which Approaches Does a Recommendation Engine Use?
  3. How Is Bought-Together Calculated? Support, Confidence and Lift
  4. How Do Similar Items and Collaborative Filtering Work?
  5. How Do You Solve Cold Start for New Products and New Visitors?
  6. Which Filters Should Recommendations Pass Through?
  7. Where Should Recommendations Go and How Do You Keep Them Varied?
  8. How Far Should Personalization Go?
  9. How Do You Measure the Effect of a Recommendation Engine?
  10. What Is the Payback of a Recommendation Engine?
  11. How Do You Build a Recommendation Engine in Six Steps?
  12. Ecommerce and Integration Foundations with İnovabil
  13. Frequently Asked Questions

Under a product page you have probably seen a strip that says "Customers who bought this also bought". In some stores it shows items you genuinely need; in others it shows the same product in six colors. The difference is rarely a fancy algorithm. It usually comes down to a few sound calculations, the right filters and honest measurement. A product recommendation engine is the system that decides which other products to show a visitor, based on the product they are viewing and how they behave.

This guide covers the recommendation algorithm itself, not the search box, product data or promotion rules: from rule-based suggestions to bought-together math, from similar items to cold start, from filters to control-group measurement. Example numbers are representative; recalculate them with your own data.

Key takeawayA good recommendation engine is not the most complex one; it is the one that does the math correctly and knows its limits. Start with simple rules, measure bought-together with lift, add stock, return and margin filters, and test the result against a control group. Measure the effect as the lift over the control group, not as "revenue from recommended items"; the gap between the two is often close to a factor of two.

What Is a Product Recommendation Engine and What Is It For?

A product recommendation engine takes product, basket and click data, generates candidate items, filters them, ranks them and places them on the page. As a catalog grows, visitors cannot find the right complement or alternative on their own; the payoff is easier access to relevant items, a higher basket value and better discovery of products that rarely get seen.

Site search serves visitors who know what they want; recommendations serve those who do not. If product data is incomplete, recommendations suffer too; see our product information management guide.

We recommend reading: Our ecommerce development service

Which Approaches Does a Recommendation Engine Use?

There are four basic approaches, and most stores use a mix. Starting with the simplest is fast and gives you a baseline for later methods.

ApproachWhat it looks atStrengthWeakness
Rule-basedBest sellers in the same category, new arrivalsFast, explainableSame result for everyone
Bought togetherProduct pairs seen in the same basketFinds complementary itemsUnreliable with few baskets
Content similarityCategory, brand, attributes, price bandWorks for new productsBlind to buying habits
Collaborative filteringUsers or items with similar purchase historyUnexpected but accurate picksWeak for new products and new visitors

The usual order is: begin with rules, add bought-together, bring in content similarity for new products, then try collaborative filtering as data accumulates; at every step, measure whether it beats the previous one. The methods here are counting and similarity calculations; they do not claim to be an AI product or a ready-made model.

How Is Bought-Together Calculated? Support, Confidence and Lift

Bought-together measures whether two products appear in the same basket more often than chance would predict. It uses three numbers: support, confidence and lift. Take a representative store with 1,000 multi-item baskets. Product A (a hiking boot) appears in 200 baskets, product B (boot-care spray) in 100, and both together in 40.

  • Support: The pair's share of all baskets. 40 ÷ 1,000 = 4.0%.
  • Confidence: Of the people who bought A, how many also bought B? 40 ÷ 200 = 20%. In the other direction, 40 ÷ 100 = 40% of spray buyers also bought the boot; confidence is not symmetric.
  • Lift: Confidence divided by the target product's overall share. B's share is 100 ÷ 1,000 = 10%, so lift = 20% ÷ 10% = 2.0.

A lift of 1.0 means "same as chance"; 2.0 means "twice what chance would give". If the two were independent, you would expect 1,000 × 0.20 × 0.10 = 20 baskets with both; the actual count is 40. We look at lift rather than confidence because of popularity: a best-selling item raises the confidence of every pair it is part of.

Lift calculation: lift 2.0 for A and B; 1.13 for A and C; 3.0 for F and A, but only 3 baskets so it is dropped
Lift removes the popularity effect; a minimum-basket threshold removes noise.
RuleTarget shareJoint basketsSupportConfidenceLiftDecision
A → B (spray)10% (100)404.0%20%2.0Show
A → C (socks)40% (400)909.0%45%1.13Do not show: lift below 1.2
A → D5% (50)40.4%2%0.4Below floor and lift < 1
F → A0.5% (5)30.3%60%3.0Below floor: 3 baskets < 20

The two thresholds in the table are representative and should be tuned to your data: at least 20 joint baskets (2%) and a lift of at least 1.2. In A → C, confidence looks high at 45%, but socks are already in 40% of all baskets; lift is 0.45 ÷ 0.40 = 1.125, so there is almost no signal. F → A has a lift of 3.0, but it rests on just 3 baskets, and a single coincidence would change it. Direction matters too: recommending the spray on the boot page makes sense; recommending the boot on the spray page usually does not.

The calculation window is also a decision: the last 90 days is a reasonable start, and promotion weeks distort normal behavior, so flag them separately (see the promotion and coupon engine guide).

How Do Similar Items and Collaborative Filtering Work?

"Similar items" follows the logic of "you liked this, take a look at these", and it can be computed in two ways: by the similarity of product attributes or by the overlap of buyers.

Content similarity compares products through attribute sets. Jaccard similarity is the number of shared attributes divided by the total number of distinct attributes. Let product X be {boot, hiking, waterproof, ₺2–3k band, brand M1}. Product Y is {boot, hiking, waterproof, ₺3–4k band, brand M1}: 4 shared, 6 in total, so similarity is 4 ÷ 6 = 0.67. Product Z is {boot, urban, ₺2–3k band, brand M2}: 2 shared, 5 + 4 − 2 = 7 in total, so 2 ÷ 7 = 0.29. Product W is {sandal, summer, ₺1–2k band, M1}: only 1 shared attribute gives 1 ÷ 8 = 0.125, and the ranking is Y, Z, W. The method works for a new product, but if product data is inconsistent, the output is inconsistent too.

Collaborative filtering looks at behavior instead of attributes: people who bought similar items like similar items. Its simplest form is item-to-item similarity, comparing items by their sets of buyers. For binary purchase data, cosine similarity = shared buyers ÷ √(buyers of A × buyers of B). For A and B: 40 ÷ √(200 × 100) = 40 ÷ 141.4 = 0.283. For A and C: 90 ÷ √(200 × 400) = 90 ÷ 282.8 = 0.318. Cosine ranks the popular socks above the spray, while lift says the opposite (2.0 versus 1.13). The metric you pick changes the result, so always sanity-check the output by eye.

We recommend reading: What is RFM analysis? A customer segmentation guide

How Do You Solve Cold Start for New Products and New Visitors?

Cold start is the problem of having no behavior data for a product or visitor. The fix is to lean on content when data is thin and shift toward behavior as it grows.

  • New product: Start with content similarity and make it visible among the category's best sellers.
  • New visitor: Use the product being viewed and the categories browsed in this session as context.
  • Handover rule: Score = w × behavior + (1 − w) × content, with w = min(1; n ÷ 50), where n is the number of baskets in which the pair has been seen (50 is a representative threshold).

Example: with 10 baskets of data, w = 10 ÷ 50 = 0.2. With a behavior score of 0.80 and a content score of 0.50, the score is 0.2 × 0.80 + 0.8 × 0.50 = 0.16 + 0.40 = 0.56. At n = 50, w = 1 and the score equals 0.80.

Which Filters Should Recommendations Pass Through?

A raw list is not always fit to publish; without a filter layer the engine keeps showing out-of-stock and heavily returned items.

  • Stock: Do not show an item whose sellable stock is below a threshold (for example 5 units).
  • Returns: Do not recommend an item with a high return rate (for example above 15%); the sale brings revenue, the return brings cost.
  • Margin floor: Drop items whose post-discount margin falls below a floor (for example 15%).
  • Already bought: Do not recommend the same item again; for consumables, show it once the repurchase interval is reached (for example after day 35 of a 45-day cycle).
  • Variant repeats: Do not count the colors and sizes of one product as separate recommendations.
CandidateRelevance (0–1)StockReturnsMarginResult
C10.9204%32%Dropped: stock
C20.884022%35%Dropped: returns
C30.85606%12%Dropped: margin
C40.80305%30%Kept
C50.78257%38%Kept
C60.60903%50%Kept

Three of the six candidates are dropped by the filters. Among the rest, margin is used only to break ties: among candidates within 90% of the best remaining relevance (0.80, so ≥ 0.72), the one with the higher margin goes first. C5 (0.78; margin 38%) moves ahead of C4 (0.80; margin 30%). C6 has a 50% margin, but its relevance of 0.60 is outside the band, so it stays last. The order is C5, C4, C6. This way margin cannot lift an irrelevant item to the top.

Where Should Recommendations Go and How Do You Keep Them Varied?

The same algorithm answers different questions on different pages.

  • Product page: "Similar items" (undecided visitors) and "Bought together" (decided visitors looking for a complement).
  • Cart: Low-priced complements and accessories. If the cart is ₺2,400, a 25% price ceiling gives ₺600; a recommendation that is expensive relative to the cart delays the decision.
  • Post-purchase: Consumables and compatible items, on the order confirmation page or in an email.

For variety, allow at most two items from the same brand or sub-category in a six-slot strip; if all six of the raw list come from one group, the rule keeps two and the other four come from the next different groups. In a carousel the first item gets the most clicks, so record the display position to account for it. Precompute the lists and serve them fast.

How Far Should Personalization Go?

There are three levels: context (only the product being viewed; no personal data needed), session (browsing within the same visit) and account history (the orders of a signed-in customer). Start with the first two; in most stores the bulk of the gain comes from there.

At the account-history level, which data may be processed, for what purpose and with which consent, plus retention and the privacy notice, fall under KVKK (Turkey's personal data protection law); consult your legal counsel for the details. For event measurement, see our customer journey guide.

How Do You Measure the Effect of a Recommendation Engine?

The effect is measured by randomly splitting visitors into a group with recommendations and a group without (or with the old rule) and comparing them. In the representative test, product-page sessions were split into two groups of 30,000 sessions each. The control group saw the old "best sellers" strip; the test group saw the new engine.

MetricControlTestDifference
Strip clicks2,100 (7.0%)3,600 (12.0%)+5 points (+71.4%)
Orders600 (2.00%)618 (2.06%)+0.06 points
Average basket₺1,000₺1,045+4.5%
Revenue per session₺20.00₺21.53+₺1.53 (+7.6%)

Revenue per session is 600 × ₺1,000 ÷ 30,000 = ₺20.00 and 618 × ₺1,045 ÷ 30,000 = ₺21.53. Two lessons follow from this table.

First, the order difference is noise. The pooled rate is 1,218 ÷ 60,000 = 2.03%; the standard error is √(0.0203 × 0.9797 × 2 ÷ 30,000) ≈ 0.00115, and z = 0.0006 ÷ 0.00115 ≈ 0.5, so the gap cannot be told apart from chance. To see a 0.06-point difference in conversion with confidence, the rule of thumb n ≈ 16 × p(1 − p) ÷ δ² calls for roughly 884,000 sessions per group. So choose metrics that the recommendation directly affects as primary: strip clicks, add-to-cart from recommendations and basket value. For test design, see our A/B testing guide.

Second, attribution inflates the effect. Say the revenue from recommended items in the test group looks like ₺84,000; some of those customers would have bought the item anyway. The true (incremental) contribution is the gap between the test and control groups' revenue: 618 × ₺1,045 = ₺645,810; 600 × ₺1,000 = ₺600,000; difference ₺45,810. Incremental contribution is 45,810 ÷ 84,000 ≈ 54.5% of attributed revenue; attribution overstates by about 1.8 times.

What Is the Payback of a Recommendation Engine?

Payback is the incremental revenue times gross margin, minus operating cost; the figures are representative.

  • Sessions that see the recommendation strip: 300,000 per month.
  • Incremental revenue per session: ₺1.527 → 300,000 × ₺1.527 = ₺458,100 per month.
  • Gross margin 30% → ₺458,100 × 0.30 = ₺137,430.
  • Operating cost (infrastructure, maintenance, monitoring): ₺25,000 per month → net ₺112,430 per month.
  • Investment ₺420,000 → 420,000 ÷ 112,430 ≈ 3.7 months.

If the effect is half as large, incremental revenue is ₺229,050, after margin ₺68,715, net ₺43,715, and payback stretches to 420,000 ÷ 43,715 ≈ 9.6 months. If the effect disappears, the cost remains, so keep monitoring against a control group.

How Do You Build a Recommendation Engine in Six Steps?

The six steps of a recommendation engine: data, candidates, filters, ranking, placement, measurement
The six steps of a recommendation engine.
  1. Prepare the data: Collect multi-item baskets, clicks and product attributes with dates; keep the catalog and stock consistent through an ERP integration.
  2. Generate candidates: Build lists with rules, lift and content similarity; set the basket and lift thresholds.
  3. Apply filters: Stock, returns, margin, already bought and variant repeats.
  4. Rank and diversify: Rank by relevance, use margin only on ties and cap items per brand.
  5. Place: Define separate recommendation types for the product page, the cart and post-purchase.
  6. Measure and iterate: Work with a random control group; track clicks and basket value as primary metrics, and attributed and incremental revenue separately.
We recommend reading: How to manage ecommerce product reviews and ratings

Ecommerce and Integration Foundations with İnovabil

At İnovabil our focus is building custom software from scratch: ecommerce, ERP, CRM, web, mobile and integration. We do not claim to have a ready-made recommendation product or an AI product; the calculations in this guide rest on basket, product and stock data being collected cleanly and connected, and that foundation is our field. Our suggestion is to define the rule-based and bought-together approach in writing, with a measurement plan, during requirements analysis, and to add more complex methods only when the data is sufficient.

We built wholesale order intake and management for Karyak, CRM, purchasing and mobile for Avcılar İnşaat, and warehouse management plus a complaints and support system for Sleepy. Send us a short summary of your store's basket and catalog data, your current infrastructure and the metrics you target, and we will work out together which recommendation type and which measurement fit. We describe how we work on our process page.

Frequently Asked Questions

What is a product recommendation engine?

It is the system that selects, filters, ranks and places related products for a visitor based on the product being viewed and their behavior. It uses approaches such as rule-based, bought-together, content similarity and collaborative filtering, alone or combined.

What is lift and why is it better than confidence?

Lift is confidence divided by the target product's overall share; 1.0 means the same as chance. Confidence makes a popular product look strong in every pair, and lift removes that effect. In the example, A → C has 45% confidence but a lift of only 1.13.

What do you do for a new product with little data?

Start with content similarity and the category's best sellers; as the number of baskets in which the pair is seen grows, the weight given to behavior is raised gradually.

How is the effect of a recommendation engine measured?

By randomly splitting visitors into a recommendation group and a control group and comparing strip clicks, add-to-cart, basket value and revenue per session. Use the gap between groups (incremental contribution), not the revenue from recommended items (attribution); attribution inflates the effect.

What should personalization consider under KVKK?

Context and session levels can start without personal data. Recommendations based on account history raise questions of purpose, consent, privacy notice and retention; consult your legal counsel for the details.

Let's talk about your project

Tell us briefly about the software you have in mind; we'll listen and prepare a tailored roadmap and proposal.

Get a quote