Skip to content
Orya One

Market Basket Analysis: What Your Customers Buy Together (and What to Do About It)

Guide13 min read

€

What the drawing shows

  1. The receiptYou need what was on each receipt, line by line, not daily totals.
  2. Juice and toast, lift 3.0A thick bar is a strong pair: with a juice, a toast becomes three times as likely.
  3. Tyropita and freddo, lift 1.08A thin bar: the freddo sells anyway, so the pair is barely above chance.
  4. The bundleThe strongest pair becomes a priced bundle. Test it before you reprint the menu.

Your receipts already show which products travel together. Here is how to read them with three simple numbers, avoid the traps that make your bestseller look like a perfect pairing, and turn the findings into bundles, menu suggestions and shelf moves you can test.

Key takeaways

  • Market basket analysis needs line-item data (what was on each receipt or order), not daily totals; a few thousand receipts is enough for your everyday items.
  • Support says how common a pair is, confidence how often B follows A, and lift whether A really makes B more likely. Sort by lift, not confidence.
  • Your bestseller will look like a great partner for everything. That is the popular-item trap, and a lift close to 1 exposes it.
  • Rules suggest what to try. Check the break-even of any bundle and test it over comparable weeks, or across days or branches, before you reprint the menu.

Market basket analysis looks at every receipt or online order and finds which products are bought together more often than chance would explain. For a café, taverna, bakery, fish shop or e-shop it answers practical questions: which items to pair on the menu, which combo is worth a price, what to put next to the till or under “add to basket”, and what to prep together. You need line-item data, meaning what was on each receipt, not daily totals, and a few thousand receipts is usually enough to start.

The method is old and well understood. Researchers at IBM described mining “association rules” from customer transactions in 1993 (Agrawal, Imieliński and Swami), and the maths fits on a napkin: three numbers called support, confidence and lift. The hard part is reading the rules honestly, avoiding the traps that make popular items look like great pairings, and testing a change before acting on it everywhere.

Below: the three numbers with a worked café example, why lift matters most, the pitfalls for seasonal Greek businesses, and how to turn rules into tested actions. If you want to predict how much you will sell rather than what sells together, see our guide to demand forecasting for seasonal businesses.

The data you need (and the data that will not work)

Basket analysis needs one row per item per receipt: a receipt or order number, the date and time, the product, the quantity and the price. Most café and restaurant POS systems can export this as a line-item or sales detail report; e-shops store it as order lines. What does not work is the daily Z report or a monthly total per product. They tell you how much of each item sold, but not what sat on the same receipt.

What a usable line-item export contains
FieldExampleWhy it matters
Receipt or order number0187Groups the items into one basket
Date and time14/08, 09:42Lets you separate mornings from evenings, and August from November
Product name or codeFreddo espresso“Freddo esp.” and “FREDDO” must count as the same item
Quantity and price2 × €2.80Shows the revenue and margin behind each rule
Channel (optional)Table, takeaway, deliveryTakeaway and dine-in baskets behave differently
Modifiers (optional)Extra shot, oat milkUseful later; usually too noisy for a first pass
What a usable line-item export contains

Two cleaning steps matter more than any algorithm. First, merge product names: a menu that changed three times in a season can list the same toast under four names. Second, group variants: “freddo espresso, sweet” and “no sugar” are one item when you look for pairs. Remove voids, staff meals and test receipts. The analysis is only as tidy as the export (see our outgrown Excel guide).

Support, confidence and lift in plain words

A rule reads “if a basket contains A, it also contains B”, written A → B. A is what is already in the basket; B is the item you might suggest. Three numbers describe it:

  • Support: the share of all baskets that contain both A and B. It tells you whether the pair matters at all. A pair on 0.2% of receipts is trivia, however strong it looks.
  • Confidence: of the baskets that contain A, the share that also contain B. It answers “when someone buys A, how often do they also buy B?” It has a direction, so A → B and B → A usually differ.
  • Lift: confidence divided by how often B is bought anyway. A lift of 1 means A tells you nothing about B. Above 1, buying A makes B more likely; below 1, less likely. A lift of 2.4 means B is 2.4 times as likely in baskets with A as in baskets in general.

Unlike confidence, lift is the same in both directions, and when two items are independent it is exactly 1, as the documentation of the Python library mlxtend notes.

A worked example: one month of receipts at a seaside café

Take an illustrative café in Paralia with 1,000 receipts over a month of weekday mornings. The numbers are invented for the example, but the arithmetic is real. Start by counting how many receipts contain each item:

Illustrative item counts from 1,000 café receipts
ItemReceipts containing itShare of all receipts
Freddo espresso60060%
Tyropita20020%
Koulouri15015%
Cappuccino12512.5%
Toast12012%
Fresh orange juice10010%
Bougatsa808%
Illustrative item counts from 1,000 café receipts

Now take one pair. 36 receipts contain both an orange juice and a toast. Step by step:

  1. Support of orange juice → toast = 36 / 1,000 = 3.6% of all receipts.
  2. Confidence = 36 / 100 receipts with orange juice = 36%. Of the guests who ordered a juice, 36% also ordered a toast.
  3. Baseline: toast appears on 120 / 1,000 = 12% of all receipts.
  4. Lift = 36% / 12% = 3.0. A juice buyer is three times as likely to order a toast as the average guest.

Another way to see lift: if juice and toast were unrelated, you would expect 1,000 × 10% × 12% = 12 receipts with both. You observed 36, three times as many. The same calculation for the other pairs gives this table of rules:

Illustrative rules. Receipts expected with both if the items were unrelated: 12, 12, 10, 120 and 90
Rule (A → B)Receipts with bothSupportConfidenceLiftHow to read it
Orange juice → Toast363.6%36%3.0Strong pair: a combo candidate
Toast → Orange juice363.6%30%3.0Same lift, lower confidence
Bougatsa → Cappuccino242.4%30%2.4Real pairing, smaller volume
Tyropita → Freddo espresso13013%65%1.08Looks strong, barely above chance
Koulouri → Freddo espresso606%40%0.67Koulouri buyers take a freddo less often than average
Illustrative rules. Receipts expected with both if the items were unrelated: 12, 12, 10, 120 and 90

Look at tyropita → freddo espresso. A confidence of 65% sounds like a discovery: almost two in three tyropita buyers also take a freddo. But 60% of all guests order a freddo anyway. Tyropita buyers are only slightly more likely to (65% against 60%), which is exactly what a lift of 1.08 says. Put a “tyropita and freddo” deal on the board and most of the discount goes to people who would have bought both at full price.

This is the popular-item trap. Whatever you sell most of, coffee in a café, bread in a bakery, water or house wine in a taverna, shows up with high confidence next to almost everything, simply because it is in most baskets. Sort rules by confidence and the top of the list fills with your bestseller. Sort by lift instead, then drop pairs with too little support to matter.

Lift below 1 is useful too: koulouri buyers take a freddo less often than average, perhaps because they are grabbing something on the way to work. That is a hypothesis to check, not a fact, but it warns you off an obvious-looking koulouri-and-coffee deal.

How the software finds the rules: Apriori and FP-Growth

With 40 items there are 780 possible pairs, so the software needs a shortcut. The classic one is Apriori (Agrawal and Srikant, 1994): it first keeps only the items that appear often enough, then builds pairs and triples from those, because a group can never be more common than its rarest member. FP-Growth (Han, Pei and Yin, 2000) compresses the receipts into a tree and skips generating candidates, which its authors found much faster on large datasets. For a small business either finishes in seconds. In Python, the open-source mlxtend library offers apriori and fpgrowth functions, plus association_rules to calculate support, confidence and lift.

Pitfalls that produce misleading rules

Tourist baskets and local baskets are different shops

In a Greek seaside business, August and November can feel like different customers. Tourists order a freddo and a fresh juice at eleven; locals order a Greek coffee and a tyropita at eight. Mix the whole year and summer drowns the winter pattern, so run the analysis separately by season and time of day.

Small samples produce lucky rules

With 100 items there are 4,950 possible pairs. Some will show a high lift by pure chance, especially among rare items: two receipts that happen to contain both a carrot cake and a mint tea can produce a spectacular lift. Set a minimum count and check that a rule holds in two different months.

Correlation is not causation

A lift of 3.0 says juice and toast travel together. It does not say that suggesting one sells more of the other. Both may simply be what a late breakfast looks like. A combo may only move existing breakfast guests to a cheaper price. Even the famous beer-and-nappies story is mostly legend: a 1992 analysis of drugstore receipts found the pair bought together in the early evening, but the chain does not appear to have moved its shelves (The Register).

Promotions and menu changes distort the data

If you already ran a “coffee and croissant €3.50” deal, the data will show coffee and croissant as a strong pair, because you made it one. Flag promotional periods and combo items, and either exclude them or analyse them separately. The same goes for items that were sold out for weeks.

A receipt is a table, not a person

In a restaurant, one receipt often covers a table of four, so the rules describe tables, not individuals. If your POS records orders per seat or per round, analyse at that level; if not, compare small receipts with large ones before drawing conclusions.

Turning rules into actions

A rule is only useful when it changes something a guest sees or something you prepare:

Bundles and combos

Bundle pairs with high lift and decent support, and price the bundle so you still make money on guests who would have bought both anyway. Avoid bundling a pair with a lift near 1: you would mostly be discounting existing sales. In a taverna, a high-lift trio such as a salad, a dip and a carafe of house wine can become a set offer for two.

Menu layout and “pairs well with”

On a printed or digital menu, place the suggestion next to the item that triggers it: “pairs well with a fresh orange juice” under the toast, not lost in the drinks section. A QR digital menu makes this cheap to change and test without reprinting. Our own Orya Menu supports up to eight languages, so a suggestion reaches guests in their own language. For the wider website, see our restaurant website guide.

E-shop “frequently bought together”

In Shopify’s Search & Discovery app, related products are generated automatically, while complementary products, up to 10 per product, are chosen by hand (Shopify Help Center). WooCommerce has cross-sells, complementary products shown in the cart, which you also set per product (WooCommerce). Basket analysis tells you which ones to pick instead of guessing. For a fish shop selling online, the rules might show that whole sea bream travels with lemons or a filleting option. Choosing the platform itself is covered in our e-shop guide.

Shelf and counter placement

In a bakery or deli, put the high-lift partner within reach: if tsoureki and a particular jam pair strongly, the jam belongs beside the tsoureki, not on the back shelf. In a fish shop, keep lemons, herbs or ready sauces by the scale. Placement is cheap to try and cheap to undo.

Purchasing and prep

Rules help in the back office too. If bougatsa and cappuccino travel together on Sunday mornings, the pastry order and the milk order should rise together. Combined with a forecast of total volume, the rules tell you how many of each pair to prepare.

Test the change before you trust it

Pick your measures before you start. For a combo, track the attach rate (the share of juice receipts that also include a toast), the average receipt value and, above all, the gross margin per receipt, because a bundle that lifts sales while discounting pairs you already sold can still lose money.

Illustrative economics: a juice at €3.50 and a toast at €3.00 cost €6.50 separately, and the bundle is €5.90, a €0.60 discount. The 36 guests a month who already order both now pay €21.60 less in total. If a toast earns a gross margin of €1.80, each new guest who adds a toast because of the bundle earns €1.80 − €0.60 = €1.20. You need €21.60 / €1.20 = 18 extra bundles a month just to break even. That is the bar the test has to clear.

  • Before and after over comparable weeks. Compare four weeks with the change against four comparable weeks without it: same season, same weekday mix, no public holiday in only one of the two periods. Check last year’s same weeks too.
  • Split by store or by day. With two branches, run the change in one and keep the other as the comparison. With one shop, alternate: change on in weeks 1 and 3, off in weeks 2 and 4. This spreads weather and tourist peaks across both sides.

Keep everything else stable during the test: no new promotions and no price changes on the same items. Online, see our guide to A/B testing for small business websites. A KPI dashboard that shows attach rate and margin per receipt every week makes the result visible without an evening in a spreadsheet.

Your first basket analysis, step by step

  1. Export three to six months of line-item sales from your POS or e-shop, with receipt number, time, product, quantity and price.
  2. Clean product names, group variants, and remove voids, staff meals and test receipts.
  3. Split the data by season and time of day, and flag promotions and existing combos.
  4. Keep the items that appear on enough receipts; your top 30 is a good start.
  5. Calculate support, confidence and lift for every pair, sort by lift and filter by a minimum count.
  6. Show the top ten rules to the people who serve: do they recognise them, and can they explain them?
  7. Pick one or two actions, write down the measure and the break-even, and test over comparable weeks.
  8. Repeat each season. Rules change when the menu, the prices and the crowd change.

Privacy: basket data without names is usually enough

Basket analysis does not need to know who the customer is. A receipt number, a time and a list of products is enough, and most café and restaurant POS exports contain no customer names at all. The GDPR applies to information about an identified or identifiable person, and not to information that is truly anonymous. Pseudonymised data, such as a customer number that can be linked back to a person, still counts as personal data (Recital 26). So the picture changes when baskets are tied to a loyalty card, an e-shop account, an email address or a card number.

The GDPR’s data minimisation principle asks that personal data be “limited to what is necessary” for the purpose (Article 5; full text on EUR-Lex). For finding what sells together, that usually means dropping names, emails and card details before the analysis starts. Customer-level analysis, such as spotting regulars who drift away, is a different project; see our guide to customer churn and RFM segmentation.

What basket analysis costs

A first analysis on one export fits our Insight package, from €1,200: data audit and cleanup, a dashboard and written findings on what to test. Rules refreshed automatically and fed into your menu or e-shop are closer to Automation, from €3,500; larger recommendation systems with custom models, pipelines and monitoring fall under ML system, from €9,000. Every project gets a fixed written quote, and if your data is too thin for useful rules, we will tell you before you commit.

How Orya One can help

At Orya One we build data and ML systems, custom software and websites for businesses across Greece, and you work directly with the people doing the analysis. In food and hospitality we have built websites for Megkas Restaurant and Fish Market Gregory, and our own QR menu, Orya Menu. We start from your receipts and your counter, not from an algorithm, and we will tell you if a pivot table already answers the question.

If you have a POS or e-shop export, send us a short description of what you sell and roughly how many receipts or orders you handle a month. A sample with customer details removed is enough to start, and we will tell you honestly whether basket analysis is worth it for you.

About the author

Dimitris Kampouridis · Founder, Orya One

Dimitris Kampouridis founded Orya One in 2026 in Paralia Katerinis, Pieria. He is a computer scientist and data scientist, with a BSc (University of Sheffield) and an MSc (University of York), and writes the code of every project himself.

More about Orya One

Frequently asked questions

What is market basket analysis in simple terms?

It is a way of reading your receipts or online orders to find which products are bought together more often than chance would explain. The result is a list of rules such as “orange juice → toast”, each with three numbers: support (how common the pair is), confidence (how often B follows A) and lift (how much more likely B becomes when A is in the basket). Businesses use the rules for bundles, menu suggestions, shelf placement, e-shop recommendations and purchasing.

What is a good lift value in market basket analysis?

A lift of 1 means the two items are unrelated. Above 1 they are bought together more often than chance; below 1, less often. As a practical first filter, look at rules with a lift of about 1.5 or more that also appear on enough receipts to matter, for example at least 20 to 30. A very high lift on a handful of receipts is usually luck, not a pattern.

How much data do I need for market basket analysis?

You need line-item data, meaning what was on each receipt or order, not daily totals. A few thousand receipts usually give usable rules for your 20 to 30 best-selling items. Rare items need much more data. Seasonal businesses should split the data by season and time of day, because tourist and local baskets often look very different.

Can I do market basket analysis in Excel?

For a handful of items, yes: a pivot table can count how many receipts contain each pair, and support, confidence and lift are simple divisions. With dozens of items the number of pairs grows quickly, and a short script using an open-source library such as mlxtend for Python is easier to run and to repeat each season. The cleaning of product names matters more than the tool.

Is market basket analysis allowed under GDPR?

Basket analysis usually needs no personal data: a receipt number, a time and the products are enough, and truly anonymous data falls outside the GDPR. Once baskets are linked to a loyalty card, an account, an email or a card number, they are personal data, and pseudonymised IDs still count. Keep only what the analysis needs, remove names and contact details first, and ask your lawyer or data protection officer about your own case.

Working on something like this?

Tell us what you need to build or improve. We reply with a clear scope and a realistic next step.

Request a free call

Keep reading

All articles