Which products earn their place? Product and category analytics for an online shop
TL;DR
Difficulty: Intermediate
Revenue is the wrong number for judging a product.
- Read each product as a funnel (shown, clicked, viewed, put in the basket, bought), and take every behaviour ratio from analytics alone, every money and stock figure from the shop database alone.
- Rank conversion by the lower bound of a Wilson interval, so a product with 40 views cannot win on luck.
- Judge products by contribution after returns, delivery and ads: a lamp with a 48.8% gross margin kept 21.3%.
- Sort the range with ABC (revenue) and XYZ (demand variability), then check sell through, stock cover and GMROI.
- Decide on dead stock with the cash still available, measure launches at category level for cannibalisation, find the products that bring customers back, and read zero result searches as a shopping list.
- Put it all in one monthly scorecard with a decision column.
A website has no shelves, so every product seems free to keep. It is not: each one ties up stock, page space and money, and some quietly cost more than they bring in. This chapter shows how to find out which products earn their place, with worked examples, SQL for a Solidus shop and a scorecard that ends in one decision per product.
Every product has to earn its shelf space, even on a website
A website has no shelves, so it is tempting to think every product can stay forever. It cannot. Every product ties up money in stock, takes a place on a category page that another product could have, needs photos, copy and a feed entry, and comes back as a return now and then. Some products pay for all of that many times over. Some quietly cost more than they bring in. Most shops cannot say which is which, because they look at one number per product: revenue.
This chapter answers one question: which products earn their place, and which ones just sit there? It reads each product as a small funnel, judges conversion fairly when views are few, works out what a product earns after returns, delivery and advertising, sorts the range with ABC and XYZ analysis, checks the stock, finds dead stock, cannibalisation and the products that bring customers back, and treats searches with no results as products you have not stocked yet. At the end, everything goes into one scorecard with one decision per product.
It builds on the tracking plan from the first chapter, because product analytics only works when the list, product and basket events carry clean product IDs.
Example: Niamh's question about 1,400 products
Shannonside Home is an invented online homeware shop in Limerick, at shannonsidehome.example. Niamh owns it, and Callum is her developer. It sells ceramics, kitchen textiles, lamps and small furniture, about 1,400 products, and ships across Ireland and to a few other EU countries. Every number about Shannonside in this article is invented for the example.
The baseline: 110,000 sessions a month, a conversion rate of 1.8%, so about 1,980 orders a month, an average order value of €84, a gross margin of 52% on product, 9% of orders returned (furniture more often), and 28% of first time customers buying again within twelve months. That is roughly €2.0 million of product revenue a year. Revenue here always means product revenue without VAT and without delivery charges, the definition chapter two settled for the purchase event.
Niamh's question: "I have 1,400 products and money tied up in a warehouse outside Limerick. Which ones do I reorder, which ones do I push, and which ones should go?" Four products run through the whole chapter:
| Product | Category | Price (ex VAT) | Units sold, last 12 months |
|---|---|---|---|
| Ochre stoneware mug set | Ceramics | €33 | 1,900 |
| Linen tea towel set | Kitchen textiles | €16.50 | 2,300 |
| Rattan floor lamp | Lamps | €162 | 120 |
| Oak bedside table | Small furniture | €220 | 60 |
Two sources, one product ID
Product analytics needs two sources. Your analytics tool (here Google Analytics 4, or GA4) sees behaviour: which products were shown in a list, clicked, viewed and put in the basket. Your shop database sees money and stock: what was ordered, at what price and cost, what came back, and what is still in the warehouse.
They meet on the product ID. Every GA4 eCommerce event carries an items array, and each item has an item_id and item_name, plus optional fields such as item_category, item_list_name and index, the position in a list1. If item_id is the same SKU (stock keeping unit, the product code) the shop database uses, the sources join cleanly. If not, fix that first.
The second rule is broken more often: take every ratio from one source. Analytics only sees visits where people accepted analytics cookies, and blockers hide more. The shop database sees every order. Divide database orders by analytics views and the numerator is complete while the denominator is a sample, so the conversion rate comes out too high. Why analytics, ads and orders disagree explains the gaps, and the consent mode article what you may see before consent. Here the rule is simple: behaviour ratios come from analytics alone, money and stock from the database alone.
Example: the lamp that looked better than it was
In December 2026, GA4 shows 3,400 views of the rattan floor lamp and 7 purchases containing it. The shop database shows 10 orders with the lamp. Callum's first report divided 10 by 3,400 and showed 0.29%. The honest figure from one source is 7 divided by 3,400, which is 0.21%.
Across the shop, GA4 sees about 71% of the orders the database records, Shannonside's own invented figure for a shop where roughly a third of visitors decline analytics cookies. Yours will differ, which is exactly why you never mix sources in one ratio.
For item level behaviour, Callum uses the GA4 BigQuery export, where each event carries its items record and purchases carry ecommerce.transaction_id2. Setting up BigQuery for a Rails and Solidus shop covers the export. This query gives the product funnel per item for December:
-- GA4 BigQuery export: the product funnel per item, December 2026
SELECT
item.item_id,
COUNTIF(event_name = 'view_item_list') AS list_views,
COUNTIF(event_name = 'select_item') AS list_clicks,
COUNTIF(event_name = 'view_item') AS product_views,
COUNTIF(event_name = 'add_to_cart') AS basket_adds,
COUNT(DISTINCT IF(event_name = 'purchase',
ecommerce.transaction_id, NULL)) AS orders
FROM `shannonside-analytics.analytics_123456789.events_*`,
UNNEST(items) AS item
WHERE _TABLE_SUFFIX BETWEEN '20261201' AND '20261231'
GROUP BY item.item_id
ORDER BY product_views DESC;
UNNEST(items) turns each event into one row per product in it. The last column counts distinct orders rather than units. GA4's standard metric "Items purchased" counts units3, which flatters products people buy in multiples, so I count orders.
List click through: is the product chosen when it is shown?
Before anyone can buy a product, they have to see it in a list (a category page, search results, a recommendation row) and choose it. GA4 records the first with view_item_list and the second with select_item1, and counts them per product as "Items viewed in list" and "Items clicked in list"3.
where is the list click through rate, is the number of times the product was clicked in a list, and is the number of times it was shown in one. A plain ratio, see Foundations: ratios and rates.
A low rate means the product loses at first glance: the thumbnail, the name, the price in the list, or a more attractive neighbour. One caution: position drives clicks. A product in the first row is clicked far more than the same product in row twelve. GA4 stores the position in index1, so compare products at similar positions.
Example: click through for the four products
December 2026, GA4 only:
| Product | Shown in lists | Clicked in lists | List click through rate |
|---|---|---|---|
| Ochre stoneware mug set | 41,000 | 1,640 | 4.0% |
| Linen tea towel set | 22,500 | 1,260 | 5.6% |
| Rattan floor lamp | 30,200 | 2,720 | 9.0% |
| Oak bedside table | 12,800 | 410 | 3.2% |
For the lamp: 2,720 divided by 30,200 is 0.090, or 9.0%. People like the look of it. The bedside table is chosen least, and Callum finds out why: on mobile it sits in the last row of the furniture page. Its low rate says as much about placement as about the table.
View to basket and basket to purchase: where each product loses people
Once someone is on a product page, two rates show where they drop out:
where is the number of product views, is the number of add to basket events for the product, is the number of orders containing it, is the view to basket rate, is the basket to purchase rate, and is the view to purchase rate. The overall rate is the product of the two steps, so you can see which step does the damage. More in Foundations: ratios and rates.
A low view to basket rate points at the product page: price, photos, missing facts. The product page chapter covers every question a page must answer. A low basket to purchase rate for one product, when checkout works for others, points at something that only appears later: a delivery charge, a delivery date, a missing payment option. The checkout chapter covers those.
Example: the lamp everyone wants and almost nobody buys
December 2026, GA4 only:
| Product | Views | Basket adds | View to basket | Orders | Basket to purchase | View to purchase |
|---|---|---|---|---|---|---|
| Ochre stoneware mug set | 3,900 | 312 | 8.0% | 112 | 35.9% | 2.87% |
| Linen tea towel set | 2,600 | 364 | 14.0% | 121 | 33.2% | 4.65% |
| Rattan floor lamp | 3,400 | 102 | 3.0% | 7 | 6.9% | 0.21% |
| Oak bedside table | 1,150 | 46 | 4.0% | 4 | 8.7% | 0.35% |
The lamp: 102 divided by 3,400 is 3.0% view to basket, and 7 divided by 102 is 6.9% basket to purchase. Check the identity: 0.030 times 0.069 is 0.0021, the same as 7 divided by 3,400. The mug set loses about two thirds of its baskets, normal for Shannonside. The lamp loses 93%.
Callum puts the lamp in a basket himself and finds it. The lamp ships by a two person courier, and the €34 bulky delivery charge first appears at checkout. Nothing on the product page says so. Shoppers like the lamp, hesitate at the price, and leave when the charge appears. The bedside table uses the same courier and shows the same pattern, so one fix, the delivery charge and date on the product page, serves both. Revenue said "the lamp sells a little". The funnel says where it breaks.
Small numbers lie: rank products by a cautious estimate
A shop with 1,400 products has a good few that only get a few dozen views a month. A product with 40 views and 4 orders converts at 10%, three times the mug set. Does it deserve the homepage? Not on that evidence. With 40 views, 4 orders could be luck.
So rank products by the lower end of a confidence interval: the lowest rate that is still plausible given the data. The Wilson score interval, published by Edwin B. Wilson in 1927, behaves well with small samples and rates near zero4, and Evan Miller's well known essay recommends its lower bound for ranking items with few observations5.
where is the cautious lower estimate of the true view to purchase rate, is the observed rate (orders divided by views), is the number of views, and is the number of standard errors for the confidence level ( for 95%). The upper bound has a plus sign in front of the square root. Foundations: confidence intervals explains intervals, and Foundations: sample size why small samples swing.
Example: the bud vase with ten per cent conversion
The Juniper bud vase had 40 views and 4 orders in December, so and . With and :
- The square root of is , and
- The denominator is
Lower bound: . Upper bound: . The vase converts somewhere between about 4.0% and 23.1%.
| Product | Views | Orders | Observed rate | 95% range |
|---|---|---|---|---|
| Juniper bud vase | 40 | 4 | 10.0% | 4.0% to 23.1% |
| Ochre stoneware mug set | 3,900 | 112 | 2.87% | 2.39% to 3.44% |
| Rattan floor lamp | 3,400 | 7 | 0.21% | 0.10% to 0.42% |
Even the cautious figure for the vase beats the mug set's upper bound, so the vase very likely converts better and deserves more exposure to find out by how much. The lamp's whole range sits below 0.5%, so its problem is real. A product with 5 views and 1 order, a "20% converter", gets a lower bound of only 3.6%. Ranking by the lower bound rewards evidence, not luck.
The chart puts twenty products on one picture. Top left are hidden gems that need exposure. Bottom right are products that get traffic and waste it.
Revenue is not contribution: what each product really earns
Revenue tells you how much money passed through a product. Contribution tells you how much stayed: revenue minus everything this product caused, the goods, refunds, return handling and write offs, delivery costs the customer did not pay, payment fees and the advertising spent on it. Fixed costs such as rent stay out, because they do not change when one more unit sells. The unit economics chapter builds this per order. Here it runs per product.
where is the contribution of product over the period, its revenue before returns, the revenue refunded for returns, the cost of goods for units customers kept, the cost of returned units that could not be resold, the cost of handling returns, the delivery cost beyond what customers paid, payment fees, and the marketing spend on the product, such as its Google Shopping spend. The contribution margin is , see Foundations: ratios and rates. Returns hit twice, sometimes three times, which the returns chapter covers in depth.
Example: the rattan floor lamp over twelve months
120 lamps sold at an average of €162 after discounts: revenue €19,440. Cost €83 a unit, so the price tag promises a gross margin of . Now the rest:
- 17 lamps came back (14%). Refunds: 17 times €162 is €2,754, so net revenue is €16,686.
- Cost of goods for the 103 lamps customers kept: 103 times €83 is €8,549.
- 4 returned lamps arrived damaged and were written off: 4 times €83 is €332.
- Handling a return costs €14: 17 times €14 is €238.
- The courier costs €44.50 a lamp and the customer pays €34, so Shannonside pays €10.50 on each: €1,260.
- Payment fees at 1.6% of revenue, not refunded on returns: €311.
- Google Shopping spend on the lamp: €2,450.
Contribution: €16,686 minus €8,549, €332, €238, €1,260, €311 and €2,450 leaves €3,546. That is €29.55 per lamp and a contribution margin of €3,546 divided by €16,686, which is 21.3%. The price tag promised 48.8%.
The tea towels, worked the same way: €37,950 of revenue, €379.50 refunded, €14,800.50 cost of goods, €32.50 written off, €80.50 handling, no delivery subsidy because they travel in ordinary parcels, €607 fees and €1,650 of Shopping spend. Contribution €20,400, or 54.3% of net revenue. Twice the lamp's revenue, more than five times its contribution.
In Solidus, each line item stores price, quantity, promo_total, included_tax_total and cost_price6, and Solidus copies the variant's cost price onto the line item when it is created, so the cost is the one at the time of sale7. This query collects the basics per product:
-- Solidus: units, net revenue (ex VAT, after line promotions) and cost per product
SELECT v.product_id,
SUM(li.quantity) AS units,
SUM(li.price * li.quantity + li.promo_total
- li.included_tax_total) AS net_revenue,
SUM(COALESCE(li.cost_price, v.cost_price, 0)
* li.quantity) AS cost_of_goods
FROM spree_line_items li
JOIN spree_orders o ON o.id = li.order_id
JOIN spree_variants v ON v.id = li.variant_id
WHERE o.completed_at >= now() - interval '12 months'
AND o.state <> 'canceled'
GROUP BY v.product_id;
included_tax_total holds the VAT inside a tax inclusive Irish price, so subtracting it gives revenue without VAT. Promotions on the whole order sit on the order, not the line, so spread them in proportion to value if they are large. Refunds come from return items, delivery subsidies from carrier invoices, and ad spend per product from the Shopping report, see the Google Shopping chapter.
ABC analysis: which few products carry the revenue
ABC analysis sorts products by what they bring in and cuts the list into three classes. Sort from highest to lowest revenue (better, contribution), add up shares as you go, and cut: A makes the first 80%, B the next 15%, C the last 5%, plus everything that sold nothing. The cut offs are a convention, not a law. Pick them once and keep them, so the classes mean the same thing every month.
where is the cumulative share of revenue of the top products, is the revenue of the product in position after sorting from highest to lowest, and is the number of products. A product is class A if the cumulative share before it, , is below 0.80, B if below 0.95, and C otherwise. See Foundations: percentages.
Example: ten products, then the whole range
Ten Shannonside products over twelve months:
| Rank | Product | Revenue | Share | Cumulative share before | Class |
|---|---|---|---|---|---|
| 1 | Ochre stoneware mug set | €62,700 | 40.1% | 0.0% | A |
| 2 | Linen tea towel set | €37,950 | 24.3% | 40.1% | A |
| 3 | Rattan floor lamp | €19,440 | 12.4% | 64.4% | A |
| 4 | Oak bedside table | €13,200 | 8.4% | 76.9% | A |
| 5 | Seagrass storage basket | €11,430 | 7.3% | 85.3% | B |
| 6 | Juniper bud vase | €4,780 | 3.1% | 92.6% | B |
| 7 | Waffle hand towel | €3,380 | 2.2% | 95.7% | C |
| 8 | Brass candle holder | €1,980 | 1.3% | 97.8% | C |
| 9 | Jute doormat | €1,050 | 0.7% | 99.1% | C |
| 10 | Felt coasters | €330 | 0.2% | 99.8% | C |
The total is €156,240, so the mug set's share is €62,700 divided by €156,240, or 40.1%. The bedside table starts at 76.9%, below 80%, so it is still an A. The waffle hand towel starts at 95.7%, so it is a C.
Over all 1,400 products, the shape is a long tail: 182 products (13%) make 80% of revenue, 294 (21%) the next 15%, and 924 (66%) share the last 5%. 212 of those sold nothing at all in twelve months.
A window function adds the classes to the previous query (saved as sales). Once you have contribution per product, run it on contribution, so a high revenue, thin margin product like the lamp drops to where it belongs:
-- ABC classes from the per product query above, saved as "sales"
WITH ranked AS (
SELECT product_id, net_revenue,
COALESCE(SUM(net_revenue) OVER (
ORDER BY net_revenue DESC
ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING), 0)
/ SUM(net_revenue) OVER () AS share_before
FROM sales
)
SELECT product_id, net_revenue,
CASE WHEN share_before < 0.80 THEN 'A'
WHEN share_before < 0.95 THEN 'B'
ELSE 'C' END AS abc_class
FROM ranked
ORDER BY net_revenue DESC;
Products with no sales are missing from sales, so left join from spree_products and mark them C. Otherwise dead stock stays invisible.
XYZ analysis: how predictable is each product's demand?
ABC says how much a product matters. XYZ says how steady its demand is, which decides how much stock you must hold to avoid running out. The measure is the coefficient of variation of demand over equal periods, usually weeks:
where is the coefficient of variation, is the standard deviation of weekly units sold, and is their mean. Dividing by the mean makes products of different sizes comparable. Foundations: spread explains the standard deviation from scratch.
Low CV is X (steady), medium Y (variable), high Z (erratic). Thresholds vary. Lokad, a company that sells forecasting software, gives X up to 10%, Y from 10% to 25% and Z above as an example, and stresses that practitioners set their own8. On weekly data for a homeware shop, where most products sell a handful a week, nearly everything would be Z under those bands. Shannonside uses X up to 0.5, Y up to 1.0, Z above. Pick bands that split your range usefully, write them down, keep them.
Example: the mug set and the lamp, week by week
| Week | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| Mug set | 12 | 9 | 11 | 14 | 10 | 13 | 9 | 10 |
| Rattan floor lamp | 0 | 3 | 0 | 0 | 7 | 1 | 0 | 5 |
Mug set: the mean is 88 divided by 8, which is 11. The squared distances from the mean are 1, 4, 0, 9, 1, 4, 4 and 1, adding up to 24. Divided by 8 that is a variance of 3, and the square root gives a standard deviation of 1.73. CV: 1.73 divided by 11 is 0.16. Class X.
Lamp: the mean is 16 divided by 8, which is 2. The squared distances are 4, 1, 4, 4, 25, 1, 4 and 9, adding up to 52. Variance 6.5, standard deviation 2.55, CV 2.55 divided by 2, which is 1.28. Class Z.
Count the zero weeks. A query that only groups weeks with sales sees 3, 7, 1 and 5 for the lamp, a mean of 4 and a far lower CV. This is the most common mistake in XYZ analysis. Build a grid of every variant and every week first:
-- Weekly units per variant over 52 full weeks, zero weeks included, then CV
WITH weeks AS (
SELECT generate_series(date_trunc('week', now()) - interval '52 weeks',
date_trunc('week', now()) - interval '1 week',
interval '1 week') AS week
),
weekly AS (
SELECT li.variant_id, date_trunc('week', o.completed_at) AS week,
SUM(li.quantity) AS units
FROM spree_line_items li
JOIN spree_orders o ON o.id = li.order_id
WHERE o.completed_at >= date_trunc('week', now()) - interval '52 weeks'
AND o.completed_at < date_trunc('week', now())
AND o.state <> 'canceled'
GROUP BY 1, 2
),
grid AS (
SELECT v.id AS variant_id, w.week, COALESCE(wk.units, 0) AS units
FROM spree_variants v
CROSS JOIN weeks w
LEFT JOIN weekly wk ON wk.variant_id = v.id AND wk.week = w.week
WHERE v.deleted_at IS NULL
)
SELECT variant_id,
AVG(units) AS mean_weekly_units,
STDDEV_POP(units) / NULLIF(AVG(units), 0) AS cv
FROM grid
GROUP BY variant_id;
For a product launched mid year, start its grid at the launch week, or its early zeros make it look erratic when it was simply not for sale yet.
ABC and XYZ together: nine boxes, nine policies
Side by side, the two classifications give nine boxes, and each box deserves its own stock and marketing policy. That is the point: you stop treating 1,400 products the same way.
| X (steady) | Y (variable) | Z (erratic) | |
|---|---|---|---|
| A (top 80% of revenue) | Never run out. Reorder automatically on forecast, keep a safety stock. | Forecast with seasonality, review weekly. | Find out why demand jumps. Hold more safety stock or state longer delivery times openly. |
| B (next 15%) | Reorder automatically, smaller safety stock. | Review monthly. | Smaller batches, ordered more often. |
| C (last 5%) | Keep lean, consider bundles. | Review each season. | Made to order, dropshipping or delisting. |
The forecasting behind "reorder on forecast" is its own chapter.
Know the limits. Lokad points out that the nine boxes miss trends and seasons, that products jump boxes when you change the time window, that thresholds are arbitrary, and that a product's indirect value, such as a modest seller that pulls other sales along, is ignored8. All fair. I use the grid as a first sort that tells you where to look, never as the decision. The scorecard at the end adds what it misses.
Example: the grid at Shannonside
| X | Y | Z | Total | |
|---|---|---|---|---|
| A | 64 | 88 | 30 | 182 |
| B | 41 | 139 | 114 | 294 |
| C | 9 | 187 | 516 | 712 |
| No sales | 212 | |||
| Total | 1,400 |
The 64 AX products, the mug set and tea towels among them, are the backbone. Running out of them is Shannonside's most expensive mistake, so they get automatic reordering and safety stock. The 30 AZ products, the lamp among them, sell a lot but in bursts, so Niamh finds the cause of each burst before buying deeper. The 516 CZ products and the 212 without sales, 728 together, are where the next sections look for money tied up in stock.
Sell through rate and stock cover: is the stock moving?
Sell through rate looks back: of the units available, how many sold?
where is the sell through rate for the period, is the units sold, is the stock at the start, and is the units received during the period. A ratio, see Foundations: ratios and rates.
Stock cover looks forward: how many weeks will today's stock last?
where is the stock cover in weeks, is the units on hand, and is the expected weekly demand, an average of recent weeks or better a forecast that knows the season, see Foundations: seasonality. In Solidus, units on hand live in count_on_hand on each stock item6.
Gross margin return on inventory (GMROI) adds money: the gross margin a product earns per euro of stock held for it.
where is the gross margin return on inventory, is the gross margin over the period (net revenue minus cost of goods sold and written off), and is the average stock at cost. Below 1, the product earns less in a year than the money it ties up. See Foundations: ratios and rates.
Example: the lamp's stock
On 1 January Shannonside had 40 lamps and received 160 during the year, so 200 were available. It sold 120.
So . The 80 lamps never sold are still on the shelf, and 13 of the 17 returns were resold as new, so 93 are on hand. Over the last twelve weeks the lamp sold 2.1 a week.
So : almost 44 weeks of stock for a product the supplier delivers in six. Gross margin: €16,686 minus €8,549 and €332 is €7,805. Average stock at cost: lamps times €83, which is €5,519.50.
So : each euro of lamps in the warehouse earned €1.41 of gross margin in the year. The tea towels, with four weeks of cover, earn far more on far less stock. Niamh stops the next lamp order until the delivery charge fix lifts the rate of sale.
Dead stock: decide with the money still on the table
Dead stock has stopped selling. A workable definition: units on hand and no sale in 180 days. Slow stock is the step before: more than 52 weeks of cover. Both cost money every month: space, capital, damage, and styles that date. Estimate your own holding cost as a share of stock value per year.
The trap is the cost price. What you paid is gone whatever you do next, a sunk cost. Compare only the cash each option brings in from today, minus what it costs from today. That is an expected value comparison, see Foundations: expected value. How much a price cut lifts demand is elasticity, see Foundations: elasticity, and the offers and promotions chapter does the full maths of discounts.
where is the expected cash value of an option from today, runs over the possible scenarios, is the probability of scenario , is the revenue from sales in it, is what the leftover stock fetches at the end, and is the holding cost until then.
Example: 60 glazed oval platters
Callum's report lists 212 products with no sale in twelve months, holding €44,800 of stock at cost, and 146 products with more than 52 weeks of cover, holding €71,400. Niamh puts her holding cost at 18% a year, so the dead stock costs about €8,064 a year to keep and the slow stock €12,852.
One slow product: 60 glazed oval platters, bought at €19, priced at €49 without VAT, selling 0.5 a week. A clearance buyer offers €7 each. Over the next 26 weeks:
A, keep the full price. 13 sold for €637. The 47 left go to clearance for €329. Holding cost: average stock platters times €19 times 18% times half a year is €91. Value: €875.
B, mark down 30% to €34.30. With a 60% chance sales rise to 2 a week: 52 sold for €1,783.60, 8 left for €56, holding €58, value €1,781.60. With a 40% chance only to 1.2 a week: 31 sold for €1,063.30, 29 left for €203, holding €76, value €1,190.30. Expected value: , about €1,545.
C, clear all 60 now. 60 times €7 is €420.
The markdown wins, even in its weaker scenario. The €19 cost appears nowhere, because it was spent in every option. Keeping the full price only makes sense for a classic that slowed for a season, rarely for a platter in last year's glaze.
The law when you announce a markdown
Announce "was €49, now €34.30" and Irish price rules apply. Regulation 5A of the price indication regulations, inserted by S.I. No. 597 of 2022, requires a trader who announces a price reduction to show the prior price in that announcement: the lowest price applied to the product during a period of not less than 30 days before the reduction, and for consecutive reductions, the lowest price in the 30 days before the first one9. The Competition and Consumer Protection Commission (CCPC) explains the rule for businesses, including that the day the reduction starts does not count towards the 30 days10. The rule is about the price customers see, including VAT, not the net price in the example. So keep a price history table, written whenever a price changes, and the prior price becomes a query, not a guess. This is general information, not legal advice. Check a specific campaign with a solicitor, and the CCPC's business guidance is a good first stop.
Cannibalisation: when a new best seller only moves sales around
A new product that sells well is not necessarily new money. If its buyers would otherwise have bought a similar product from you, it only moved sales between pages. That is cannibalisation, and product reports cannot show it, because each product is measured alone. You see it one level up, in the category, against what the category would have done without the launch.
The method is a simple difference in differences: compare the category's change with a similar category that had no launch over the same weeks, so the season cancels out. Causal inference in marketing covers the method and its assumptions.
where is the incremental weekly units the launch added to the category, and are the category's average weekly units before and after, and and are the same for a comparison category. The fraction is the growth the category would have had anyway. The cannibalised units are the new product's units minus . See Foundations: indexing and base rates.
Example: the Ember table lamp
In September Shannonside launched the Ember table lamp. Six weeks later it sells 19 a week and everyone is pleased. Callum compares six weeks before and after:
| Weekly units | Before | After |
|---|---|---|
| Alder table lamp (older model) | 30 | 18 |
| Ember table lamp (new) | 0 | 19 |
| Other table lamps | 4 | 3 |
| Table lamps in total | 34 | 40 |
| Pendant lamps (comparison, no launch) | 50 | 55 |
Pendant lamps grew by 10%, because autumn is lamp season. Without the launch, table lamps would have grown the same: 34 times 1.10 is 37.4 a week. They sold 40, so the launch added units a week. Of the Ember's 19, came from other table lamps: the Alder fell from an expected 33 to 18, a loss of 15, and the others from 4.4 to 3, a loss of 1.4.
The Ember earns €31 contribution a unit, the Alder €36, the other table lamps about €23. The Ember seems to add 19 times €31, which is €589 a week. The real gain is €589 minus €540 lost on the Alder and €32.20 on the others: €16.80 a week, about €874 a year, and it pulls customers from a lamp with a better margin.
The launch is not a mistake: the Ember may bring new customers, and the Alder may be due to retire. But reordering deeply or advertising harder should rest on €16.80 a week, not €589.
Products that bring customers back
Some products are good at the first sale and nothing after. Others start relationships. Ask: of the customers whose first order contained product X, how many bought again within twelve months? Compare with the shop's 28%. The repeat purchase chapter and the cohort chapter cover the customer side. Here the focus is the product.
A higher repeat rate after a product is a correlation, not proof the product caused it. People who buy tea towels may simply furnish kitchens bit by bit. Test before you bet on it, as experiments inside your own shop shows, and see Foundations: correlation.
Example: first orders and the twelve months after
Callum takes every customer whose first order was 13 to 24 months ago, so each has a full year to come back, and identifies customers by email so guest checkouts count:
-- Repeat rate within 12 months, by product in the customer's first order
WITH firsts AS (
SELECT DISTINCT ON (lower(email))
id AS order_id, lower(email) AS customer, completed_at
FROM spree_orders
WHERE completed_at IS NOT NULL AND state <> 'canceled'
ORDER BY lower(email), completed_at
),
cohort AS (
SELECT * FROM firsts
WHERE completed_at >= now() - interval '24 months'
AND completed_at < now() - interval '12 months'
),
repeaters AS (
SELECT DISTINCT c.customer
FROM cohort c
JOIN spree_orders o
ON lower(o.email) = c.customer
AND o.completed_at > c.completed_at
AND o.completed_at <= c.completed_at + interval '12 months'
AND o.state <> 'canceled'
)
SELECT v.product_id,
COUNT(DISTINCT c.customer) AS first_customers,
ROUND(100.0 * COUNT(DISTINCT r.customer)
/ COUNT(DISTINCT c.customer), 1) AS repeat_rate_pct
FROM cohort c
JOIN spree_line_items li ON li.order_id = c.order_id
JOIN spree_variants v ON v.id = li.variant_id
LEFT JOIN repeaters r ON r.customer = c.customer
GROUP BY v.product_id
HAVING COUNT(DISTINCT c.customer) >= 100
ORDER BY repeat_rate_pct DESC;
DISTINCT ON keeps each customer's earliest order. HAVING drops products with fewer than 100 first customers, whose rates swing too much to rank.
| Product in the first order | First customers | Bought again within 12 months |
|---|---|---|
| Linen tea towel set | 640 | 36% |
| Ochre stoneware mug set | 510 | 33% |
| Seagrass storage basket | 380 | 30% |
| Oak bedside table | 120 | 21% |
| Rattan floor lamp | 290 | 17% |
| All first time customers | 6,900 | 28% |
For the tea towels, 36% of 640 is 230 people, and the Wilson interval puts the true rate between about 32% and 40%, clear of the 28% baseline. For the bedside table, 120 customers give a range of about 15% to 29%: "probably not better than average" is all you can say. So the tea towels and mugs become the products Niamh shows new visitors, because a first order with them is worth more over time than its value says.
Searches with no results are products you do not stock yet
Every search that returns nothing is a customer telling you, in their own words, what they wanted to buy from you. It is the closest thing to a list of missing products you will get.
GA4's enhanced measurement records view_search_results with the search_term when a results page loads with a search parameter such as q or search in the address11. It does not record whether anything was found. Baymard Institute's research found that about half of eCommerce sites handle "no results" pages in ways that leave users stuck12. Fixing the search itself is the site search chapter. Here the terms themselves are product research.
The reliable place to log them is the shop, which knows the result count. In a Solidus shop on the starter frontend, the products controller runs the search with the keywords parameter and gets a paginated result back13. A small model and a few lines in that controller do the logging:
# db/migrate/20270104090000_create_search_logs.rb
class CreateSearchLogs < ActiveRecord::Migration[8.0]
def change
create_table :search_logs do |t|
t.string :term, null: false
t.integer :results_count, null: false
t.string :locale
t.timestamps
end
add_index :search_logs, [:results_count, :created_at]
end
end
# app/models/search_log.rb
class SearchLog < ApplicationRecord
before_validation { self.term = term.to_s.downcase.squish.first(100) }
scope :zero_results, -> { where(results_count: 0) }
end
# app/controllers/products_controller.rb, inside index after the search ran
if params[:keywords].present?
SearchLog.create(term: params[:keywords],
results_count: @products.total_count,
locale: I18n.locale.to_s)
end
The log keeps the term and the count, nothing that identifies the visitor: no user, no session, no cookie. People occasionally type a name or an email into a search box, so trim terms, delete old logs with a nightly job, and mention the log in your privacy notice. The monthly report is one line:
SearchLog.zero_results.where(created_at: 1.month.ago..)
.group(:term).order(Arel.sql("COUNT(*) DESC")).limit(20).count
Example: what Shannonside's customers asked for in December
14,300 searches ran in December, and 1,290 of them, 9.0%, found nothing. Callum sorts the top terms by the fix each needs:
| Search term | Searches | What it is | Fix |
|---|---|---|---|
| bread bin | 212 | Not stocked | Source and test |
| doormat | 148 | Stocked as "jute mat" | Synonym |
| oven gloves | 131 | Stocked as "oven mitts" | Synonym |
| lampshade | 96 | Not stocked, only complete lamps | Source and test |
| terracota | 77 | Misspelling of terracotta | Spelling tolerance |
Synonyms and misspellings take an afternoon. Missing products are buying decisions, and the log puts a rough value on them. Shannonside's searchers convert at 4.1% (GA4, one source for both numbers). If bread bins converted like any searched product:
So : about €730 of revenue a month from people who already searched, about €380 of gross margin at 52%, close to €4,600 a year, before counting anyone who assumed Shannonside does not sell bread bins. Rough, because a bread bin is not an average product, but enough to justify a small first batch and a month of watching its funnel.
Category analytics: the same questions one level up
Every number above rolls up to the category, where it answers different questions: where the buying budget goes, which category page to rebuild first, which part of the range to advertise. The category pages chapter covers the page itself.
Since Solidus 4.5 a product can have a primary taxon, its main category, stored as primary_taxon_id14. Group by that. Without it, products sit in several taxons through classifications, and unless you choose one per product, revenue is counted in every category and the totals pass 100%.
Example: Shannonside's four categories
| Category | Products | Share of revenue | Contribution margin | Units returned | Sell through | Share of first orders |
|---|---|---|---|---|---|---|
| Ceramics | 520 | 31% | 27% | 4% | 64% | 34% |
| Kitchen textiles | 310 | 22% | 31% | 2% | 71% | 29% |
| Lamps | 240 | 27% | 16% | 11% | 48% | 21% |
| Small furniture | 330 | 20% | 9% | 19% | 39% | 16% |
Furniture makes a fifth of revenue, keeps 9% of it as contribution, sees almost one unit in five come back, sells through 39% of its stock and rarely starts a relationship. Textiles are the opposite on every column. Niamh should not drop furniture, because some customers come for a table and leave with mugs. But furniture gets its own fixes (delivery charge on the page, better size facts, smaller buys), and new buying and advertising money goes to textiles and ceramics first.
The product scorecard: one row per product, one decision
Everything above comes together in one monthly table, one row per product, with one column that matters most: the decision. Without it, a scorecard is a report. With it, it is a work plan. The decision follows a fixed order of questions, so two people with the same numbers reach the same answer:
Example: Niamh's scorecard for January
| Product | Class | List CTR | View to purchase (95% range) | Contribution margin | Returns | Cover | Repeat after first order | Decision |
|---|---|---|---|---|---|---|---|---|
| Linen tea towel set | AX | 5.6% | 4.65% (3.9% to 5.5%) | 54.3% | 1% | 4 weeks | 36% | Keep, never run out, lead product in new customer ads |
| Ochre stoneware mug set | AX | 4.0% | 2.87% (2.4% to 3.4%) | 41% | 3% | 5 weeks | 33% | Keep, reorder on forecast |
| Rattan floor lamp | AZ | 9.0% | 0.21% (0.1% to 0.4%) | 21.3% | 14% | 44 weeks | 17% | Stop reordering, show bulky delivery on the page, review in March |
| Oak bedside table | BZ | 3.2% | 0.35% (0.1% to 0.9%) | 6% | 19% | 60 weeks | 21% | Stop reordering, fix delivery and size facts, move it up the page |
| Juniper bud vase | CY | 6.1% | 10.0% (4.0% to 23.1%) | 44% | 2% | 9 weeks | too few | More exposure: first row of its category, Shopping |
| Glazed oval platter | CZ | 2.2% | 0.8% (0.3% to 2.3%) | 38% | 2% | 120 weeks | too few | Markdown 30%, clearance at the end of June |
Run the lamp through the flow. Contribution is positive, so yes. Cover is 44 weeks, above 26, so stop reordering. The funnel already found the cause, the hidden delivery charge, so the page fix comes first and a markdown only if the stock still sits in March. The vase passes the first three questions and is viewed far less than its category's median, so it gets exposure. If its rate holds with more views, it can become a B within a season.
Build the scorecard as one query on the shop database plus the analytics export, refreshed every night, and have a person fill in the decision column once a month. The numbers can be automatic. The decision should not be.
Conclusion
Revenue is the wrong number for judging a product. Read each product as a funnel, take behaviour ratios from analytics and money and stock from the database, never mixed, and rank by the cautious end of a confidence interval so luck does not win. Judge products by contribution after returns, delivery and advertising, sort them with ABC and XYZ to know where to look, and check stock with sell through, cover and GMROI. Decide on dead stock with the cash still available, never the price you paid. Measure launches at category level, find the products that bring customers back, and read zero result searches as a shopping list. Then put it all in one scorecard with a decision column, and fill it in every month.