Market basket analysis for Magento orders, turned into a test backlog.
Magento keeps every order in your own database. Export it as a Shopify-shaped CSV with one query, drop it into Affinsy, and get the products your customers buy together, segments by purchase behavior, and ranked experiments to run. No extension to install.
7-day free trial · First report in minutes
What market basket analysis finds inMagento order data.
Market basket analysis is a data mining technique that reads every order in your Magento store and finds the products that land in the same basket more often than chance would predict. The output is a list of association rules: if a customer buys product A, how likely they are to also buy product B, and how much more likely than a random shopper. Every rule is ranked by revenue impact rather than statistical lift alone, and arrives with the hypothesis it supports.
How often the pair appears together across all orders. Salvia 'Caradonna' and Lavandula 'Hidcote' share a basket in 10.4% of the sample store's orders, so the rule rests on hundreds of real transactions rather than a handful.
How often the second product follows the first. 67% of baskets holding the Salvia also hold the Lavandula, which decides whether a product-page recommendation lands.
How much more likely the pair is than chance. A lift of 2.9 means customers who buy the Salvia are almost three times as likely to buy the Lavandula as a random customer. Above 1 is a real association; below 1 is a pair of substitutes that cannibalise each other.
Beyond the same basket,what else the report sees.
The minimum-support floor adapts to your order count, between 0.3% and 5%, so a 2,000-order store and a 200,000-order store both get rules that hold up. Substitute pairs and out-of-stock products are filtered out of the ranked list by default, because a bundle built on two products that replace each other loses money.
Same-basket rules cannot tell you which product opens the relationship. Purchase order looks across a customer's later orders and reports which product tends to come first, so you know what to lead with in ads and on the homepage.
Consumables come back on a rhythm the basket view never shows. In the sample store, pine bark mulch is reordered every 129 days on average by 278 repeat buyers: a reorder reminder waiting to be scheduled, with the audience already built.

How your Magento data gets in
Magento (Adobe Commerce and Open Source) has no one-click order export at line-item granularity, so you shape the data yourself. The trick: export it with Shopify's column names, and Affinsy reads it as a native Shopify order file.
- Run the query below against your Magento database (read replica is fine). It reads sales_order joined to sales_order_item, one row per line item.
- Keep the parent_item_id IS NULL filter: configurable and bundle products write both a parent and child row, so without it every such line item is counted twice.
- Save the result as UTF-8 CSV using the aliased column names as headers. Those are Shopify's column names, so Affinsy detects the layout and maps it automatically.
SELECT
o.increment_id AS "Name",
o.customer_email AS "Email",
o.status AS "Financial Status",
o.order_currency_code AS "Currency",
o.subtotal AS "Subtotal",
o.shipping_amount AS "Shipping",
o.tax_amount AS "Taxes",
o.grand_total AS "Total",
i.qty_ordered AS "Lineitem quantity",
i.name AS "Lineitem name",
i.price AS "Lineitem price",
i.sku AS "Lineitem sku",
o.created_at AS "Created at"
FROM sales_order o
JOIN sales_order_item i ON i.order_id = o.entity_id
WHERE i.parent_item_id IS NULL
ORDER BY o.entity_id, i.item_id;- Copy your signed webhook URL from the Affinsy dashboard.
- Add a sales_order_place_after observer (Open Source) or an Adobe Commerce webhook that POSTs the new order to your URL.
- New orders stream in automatically from then on, no scheduled export to remember.
- Create a dataset and authenticate with your API key.
- POST orders to /api/v1/data/orders from your pipeline, one by one or in batches.
- Trigger runs and pull results over /api/v1/reports, or get a webhook when a run finishes.
Two reports and a plan,from one order history.

Association rules over your real orders: which products pull each other into the cart, how often, and what each pairing is worth. Ranked by revenue impact, not just statistical lift.
Every customer scored on recency, frequency, and monetary value, then grouped into segments like Champions, Loyal, At risk, and Hibernating, each with counts and revenue share. Acquisition cohorts show which months' new customers came back and what they are worth.
Each finding comes with a hypothesis you can act on: the bundle to offer, the segment to target, the cross-sell to test, ranked so you know where to start.
Running Magento stores for clients?
One workspace, one dataset per client, on a flat $299/month for up to 10 client datasets. Schedule reruns on your cadence and walk into every QBR with a fresh, statistically backed test backlog instead of rebuilding spreadsheets the night before.
What to do with the ruleson Magento.
The report ends in a ranked test backlog. These are the four places its findings usually go on a Magento store.
Take the top rules by revenue with lift above 1.5 and enough support behind them, and build them as bundle products in Magento. Start with pairs the substitute filter has already cleared.
Magento's product editor has related products, up-sells, and cross-sells built in: put the highest-confidence consequent in cross-sells so it shows in the cart, and the strongest pairing in related products.
Export any RFM segment as a CSV with Klaviyo, Omnisend, or MailerLite headers and send it its own offer: win-back for At risk, early access for Champions, a second-order nudge for new customers. The rules tell you which product to put in the email.
For products on a replenishment cycle, schedule a reminder just before the observed gap. Affinsy builds the audience of customers due in that window, so the email reaches people who are about to run out rather than everyone who ever bought.

Magento specifics
Magento has no built-in order export at line-item granularity, and Market Basket Analysis needs one row per product in each order. A single query against sales_order and sales_order_item gives you exactly that. If your team already exports orders another way, any CSV with an order ID, order date, and product name works too.
Affinsy already recognizes Shopify's order export layout and maps it automatically. By exporting your Magento data with the same column headers (Name, Email, Lineitem name, and so on), you skip manual column matching. It is a labeling convenience, not a Shopify dependency.
Configurable and bundle products in Magento write two rows into sales_order_item: a parent and its child. Filtering to parent_item_id IS NULL keeps one row per real line item, so quantities and co-purchase counts are not inflated.
A data mining technique that finds products bought together more often than chance would predict. It works on transaction data you already have: one row per product per order. Affinsy runs it on your Magento order export and reports each pairing with its support, confidence, lift, and the revenue flowing through it.
Association rule mining with a minimum-support floor that adapts to your order count for same-basket rules, and PrefixSpan for the purchase-order sequences across a customer's later orders. You never set thresholds by hand; a re-run dialog is there if you want to override them.
Export your orders, upload the file, and start the analysis; the first report is ready in minutes. The result is a ranked list of association rules with the revenue behind each one, plus RFM segments and a test backlog built from the same order history. No spreadsheet formulas, no Python.
RFM segmentation works from your first upload. Market Basket Analysis gets stronger with more co-purchase history: the more orders you include, the more reliable the bought-together rules become, so export the widest date range you can.
Affinsy only needs a stable per-customer identifier for segmentation. You can use a customer number or a hashed email instead of a raw address if you prefer to keep PII out. If you plan to export segments to an email tool later, keep real email addresses in the data.
Your next bundle is alreadyin your order history.
Export your Magento orders and see the first report in minutes.
Order data from: Affinsy for Shopify · Affinsy for WooCommerce · Affinsy for Shoper · Affinsy for Haravan · Affinsy for Shopee · Affinsy for PrestaShop
Segments out to: Affinsy for Klaviyo · Affinsy for MailerLite · Affinsy for Omnisend
