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.9% gross margin kept 21.4%.
  • 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: Priya's question about 1,400 products

Wrenfield Home is an invented online homeware shop in Leeds, at wrenfieldhome.example. Priya owns it, and Callum is her developer. It sells ceramics, kitchen textiles, lamps and small furniture, about 1,400 products, and ships across the UK and to a few neighbouring countries. Every number about Wrenfield 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 £72, 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 £1.71 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.

Priya's question: "I have 1,400 products and money tied up in a warehouse in Leeds. Which ones do I reorder, which ones do I push, and which ones should go?" Four products run through the whole chapter:

ProductCategoryPrice (ex VAT)Units sold, last 12 months
Ochre stoneware mug setCeramics£281,900
Linen tea towel setKitchen textiles£142,300
Rattan floor lampLamps£139120
Oak bedside tableSmall furniture£18960

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, Wrenfield'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 `wrenfield-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.

CTRlist=ClistVlist\text{CTR}_{\text{list}} = \frac{C_{\text{list}}}{V_{\text{list}}}

where CTRlist\text{CTR}_{\text{list}} is the list click through rate, ClistC_{\text{list}} is the number of times the product was clicked in a list, and VlistV_{\text{list}} 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:

ProductShown in listsClicked in listsList click through rate
Ochre stoneware mug set41,0001,6404.0%
Linen tea towel set22,5001,2605.6%
Rattan floor lamp30,2002,7209.0%
Oak bedside table12,8004103.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:

rbasket=AV,rbuy=OA,rview=OV=rbasket×rbuyr_{\text{basket}} = \frac{A}{V}, \qquad r_{\text{buy}} = \frac{O}{A}, \qquad r_{\text{view}} = \frac{O}{V} = r_{\text{basket}} \times r_{\text{buy}}

where VV is the number of product views, AA is the number of add to basket events for the product, OO is the number of orders containing it, rbasketr_{\text{basket}} is the view to basket rate, rbuyr_{\text{buy}} is the basket to purchase rate, and rviewr_{\text{view}} 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:

ProductViewsBasket addsView to basketOrdersBasket to purchaseView to purchase
Ochre stoneware mug set3,9003128.0%11235.9%2.87%
Linen tea towel set2,60036414.0%12133.2%4.65%
Rattan floor lamp3,4001023.0%76.9%0.21%
Oak bedside table1,150464.0%48.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 Wrenfield. 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 £29 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 long tail of products with 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.

plow=p^+z22n−zp^(1−p^)n+z24n21+z2np_{\text{low}} = \frac{\hat{p} + \dfrac{z^2}{2n} - z\sqrt{\dfrac{\hat{p}(1-\hat{p})}{n} + \dfrac{z^2}{4n^2}}}{1 + \dfrac{z^2}{n}}

where plowp_{\text{low}} is the cautious lower estimate of the true view to purchase rate, p^\hat{p} is the observed rate (orders divided by views), nn is the number of views, and zz is the number of standard errors for the confidence level (z=1.96z = 1.96 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 p^=0.10\hat{p} = 0.10 and n=40n = 40. With z=1.96z = 1.96 and z2=3.8416z^2 = 3.8416:

  1. z2/2n=3.8416/80=0.0480z^2 / 2n = 3.8416 / 80 = 0.0480
  2. p^(1−p^)/n=0.10×0.90/40=0.00225\hat{p}(1-\hat{p})/n = 0.10 \times 0.90 / 40 = 0.00225
  3. z2/4n2=3.8416/6,400=0.00060z^2 / 4n^2 = 3.8416 / 6{,}400 = 0.00060
  4. The square root of 0.00225+0.00060=0.002850.00225 + 0.00060 = 0.00285 is 0.05340.0534, and 1.96×0.0534=0.10461.96 \times 0.0534 = 0.1046
  5. The denominator is 1+3.8416/40=1.09601 + 3.8416 / 40 = 1.0960

Lower bound: (0.10+0.0480−0.1046)/1.0960=0.0396(0.10 + 0.0480 - 0.1046) / 1.0960 = 0.0396. Upper bound: (0.10+0.0480+0.1046)/1.0960=0.2305(0.10 + 0.0480 + 0.1046) / 1.0960 = 0.2305. The vase converts somewhere between about 4.0% and 23.1%.

ProductViewsOrdersObserved rate95% range
Juniper bud vase40410.0%4.0% to 23.1%
Ochre stoneware mug set3,9001122.87%2.39% to 3.44%
Rattan floor lamp3,40070.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.

Scatter plot of 20 Wrenfield Home products in December 2026, invented example data. Horizontal axis: product views in the month on a log scale from 40 to about 4,000. Vertical axis: view to purchase rate in percent. The Juniper bud vase sits top left with 40 views and 10.0%. The linen tea towel set has 2,600 views and 4.65%, the mug set 3,900 views and 2.87%. The rattan floor lamp sits bottom right with 3,400 views and 0.21%, the oak bedside table 1,150 views and 0.35%. The trend line falls slightly as views rise. Tap or click to open full screen and move around

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.

CMi=Ri−Fi−Gi−Wi−Hi−Si−Pi−MiCM_i = R_i - F_i - G_i - W_i - H_i - S_i - P_i - M_i

where CMiCM_i is the contribution of product ii over the period, RiR_i its revenue before returns, FiF_i the revenue refunded for returns, GiG_i the cost of goods for units customers kept, WiW_i the cost of returned units that could not be resold, HiH_i the cost of handling returns, SiS_i the delivery cost beyond what customers paid, PiP_i payment fees, and MiM_i the marketing spend on the product, such as its Google Shopping spend. The contribution margin is CMi/(Ri−Fi)CM_i / (R_i - F_i), 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 £139 after discounts: revenue £16,680. Cost £71 a unit, so the price tag promises a gross margin of (139−71)/139=48.9%(139 - 71) / 139 = 48.9\%. Now the rest:

  • 17 lamps came back (14%). Refunds: 17 times £139 is £2,363, so net revenue is £14,317.
  • Cost of goods for the 103 lamps customers kept: 103 times £71 is £7,313.
  • 4 returned lamps arrived damaged and were written off: 4 times £71 is £284.
  • Handling a return costs £12: 17 times £12 is £204.
  • The courier costs £38 a lamp and the customer pays £29, so Wrenfield pays £9 on each: £1,080.
  • Payment fees at 1.6% of revenue, not refunded on returns: £267.
  • Google Shopping spend on the lamp: £2,100.

Contribution: £14,317 minus £7,313, £284, £204, £1,080, £267 and £2,100 leaves £3,069. That is £25.57 per lamp and a contribution margin of £3,069 divided by £14,317, which is 21.4%. The price tag promised 48.9%.

Waterfall chart for Wrenfield Home's rattan floor lamp over twelve months, invented example data in pounds. Revenue 16,680. Minus refunds 2,363, cost of goods for kept units 7,313, written off returns 284, return handling 204, delivery subsidy 1,080, payment fees 267 and Google Shopping 2,100. Contribution left: 3,069, a contribution margin of 21.4% against a gross margin of 48.9% on the price tag. Tap or click to open full screen and move around

The tea towels, worked the same way: £32,200 of revenue, £322 refunded, £12,751 cost of goods, £28 written off, £69 handling, no delivery subsidy because they travel in ordinary parcels, £515 fees and £1,400 of Shopping spend. Contribution £17,115, or 53.7% 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 UK 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.

Sk=∑i=1kR(i)∑i=1NR(i)S_k = \frac{\sum_{i=1}^{k} R_{(i)}}{\sum_{i=1}^{N} R_{(i)}}

where SkS_k is the cumulative share of revenue of the top kk products, R(i)R_{(i)} is the revenue of the product in position ii after sorting from highest to lowest, and NN is the number of products. A product is class A if the cumulative share before it, Sk−1S_{k-1}, is below 0.80, B if below 0.95, and C otherwise. See Foundations: percentages.

Example: ten products, then the whole range

Ten Wrenfield products over twelve months:

RankProductRevenueShareCumulative share beforeClass
1Ochre stoneware mug set£53,20040.0%0.0%A
2Linen tea towel set£32,20024.2%40.0%A
3Rattan floor lamp£16,68012.5%64.2%A
4Oak bedside table£11,3408.5%76.7%A
5Seagrass storage basket£9,8007.4%85.2%B
6Juniper bud vase£4,1003.1%92.6%B
7Waffle hand towel£2,9002.2%95.7%C
8Brass candle holder£1,7001.3%97.8%C
9Jute doormat£9000.7%99.1%C
10Felt coasters£2800.2%99.8%C

The total is £133,100, so the mug set's share is £53,200 divided by £133,100, or 40.0%. The bedside table starts at 76.7%, 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.

Grouped bar chart for Wrenfield Home's 1,400 products over twelve months, invented example data. Class A: 13% of products, 80% of revenue. Class B: 21% of products, 15% of revenue. Class C: 66% of products, 5% of revenue, including 212 products with no sale at all. Tap or click to open full screen and move around

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:

CV=σμCV = \frac{\sigma}{\mu}

where CVCV is the coefficient of variation, σ\sigma is the standard deviation of weekly units sold, and μ\mu 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. Wrenfield 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

Week12345678
Mug set12911141013910
Rattan floor lamp03007105

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 Wrenfield

XYZTotal
A648830182
B41139114294
C9187516712
No sales212
Total1,400

The 64 AX products, the mug set and tea towels among them, are the backbone. Running out of them is Wrenfield'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 Priya 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?

ST=UsoldIstart+UreceivedST = \frac{U_{\text{sold}}}{I_{\text{start}} + U_{\text{received}}}

where STST is the sell through rate for the period, UsoldU_{\text{sold}} is the units sold, IstartI_{\text{start}} is the stock at the start, and UreceivedU_{\text{received}} 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?

Cweeks=InowdˉC_{\text{weeks}} = \frac{I_{\text{now}}}{\bar{d}}

where CweeksC_{\text{weeks}} is the stock cover in weeks, InowI_{\text{now}} is the units on hand, and dˉ\bar{d} 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 pound of stock held for it.

GMROI=GMIˉcost\text{GMROI} = \frac{GM}{\bar{I}_{\text{cost}}}

where GMROI\text{GMROI} is the gross margin return on inventory, GMGM is the gross margin over the period (net revenue minus cost of goods sold and written off), and Iˉcost\bar{I}_{\text{cost}} 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 Wrenfield had 40 lamps and received 160 during the year, so 200 were available. It sold 120.

ST=12040+160=0.60ST = \frac{120}{40 + 160} = 0.60

So ST=60%ST = 60\%. 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.

Cweeks=932.1=44.3C_{\text{weeks}} = \frac{93}{2.1} = 44.3

So Cweeks≈44C_{\text{weeks}} \approx 44: almost 44 weeks of stock for a product the supplier delivers in six. Gross margin: £14,317 minus £7,313 and £284 is £6,720. Average stock at cost: (40+93)/2=66.5(40 + 93) / 2 = 66.5 lamps times £71, which is £4,722.

GMROI=6,7204,722=1.42\text{GMROI} = \frac{6{,}720}{4{,}722} = 1.42

So GMROI=1.42\text{GMROI} = 1.42: each pound of lamps in the warehouse earned £1.42 of gross margin in the year. The tea towels, with four weeks of cover, earn far more on far less stock. Priya 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.

E[V]=∑sqs(Rs+Ls−Hs)E[V] = \sum_{s} q_s \left( R_s + L_s - H_s \right)

where E[V]E[V] is the expected cash value of an option from today, ss runs over the possible scenarios, qsq_s is the probability of scenario ss, RsR_s is the revenue from sales in it, LsL_s is what the leftover stock fetches at the end, and HsH_s is the holding cost until then.

Example: 60 glazed oval platters

Callum's report lists 212 products with no sale in twelve months, holding £38,400 of stock at cost, and 146 products with more than 52 weeks of cover, holding £61,200. Priya puts her holding cost at 18% a year, so the dead stock costs about £6,912 a year to keep and the slow stock £11,016.

One slow product: 60 glazed oval platters, bought at £16, priced at £42 without VAT, selling 0.5 a week. A clearance buyer offers £6 each. Over the next 26 weeks:

A, keep the full price. 13 sold for £546. The 47 left go to clearance for £282. Holding cost: average stock (60+47)/2=53.5(60 + 47) / 2 = 53.5 platters times £16 times 18% times half a year is £77. Value: £751.

B, mark down 30% to £29.40. With a 60% chance sales rise to 2 a week: 52 sold for £1,528.80, 8 left for £48, holding £49, value £1,527.80. With a 40% chance only to 1.2 a week: 31 sold for £911.40, 29 left for £174, holding £64, value £1,021.40. Expected value: 0.6×1,527.80+0.4×1,021.40=1,325.240.6 \times 1{,}527.80 + 0.4 \times 1{,}021.40 = 1{,}325.24, about £1,325.

C, clear all 60 now. 60 times £6 is £360.

The markdown wins, even in its weaker scenario. The £16 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 £42, now £29.40" and consumer law applies. In the UK, false or misleading information about a product, including a deceptive overall presentation, is a misleading action under section 226 of the Digital Markets, Competition and Consumers Act 20249. The Chartered Trading Standards Institute's guidance on pricing practices explains how reference prices are judged: the "was" price should be a genuine recent price, the reduced price should not run materially longer than the higher one did, and a comparison with a price that was not the last one charged is less likely to comply10. So keep a price history table, written whenever a price changes, and the real previous price becomes a query, not a guess. This is general information, not legal advice. Check a specific campaign with a solicitor or your local Trading Standards service.

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.

Δinc=Yafter−Ybefore×KafterKbefore\Delta_{\text{inc}} = Y_{\text{after}} - Y_{\text{before}} \times \frac{K_{\text{after}}}{K_{\text{before}}}

where Δinc\Delta_{\text{inc}} is the incremental weekly units the launch added to the category, YbeforeY_{\text{before}} and YafterY_{\text{after}} are the category's average weekly units before and after, and KbeforeK_{\text{before}} and KafterK_{\text{after}} 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 Δinc\Delta_{\text{inc}}. See Foundations: indexing and base rates.

Example: the Ember table lamp

In September Wrenfield 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 unitsBeforeAfter
Alder table lamp (older model)3018
Ember table lamp (new)019
Other table lamps43
Table lamps in total3440
Pendant lamps (comparison, no launch)5055

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 40−37.4=2.640 - 37.4 = 2.6 units a week. Of the Ember's 19, 19−2.6=16.419 - 2.6 = 16.4 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 £27 contribution a unit, the Alder £31, the other table lamps about £20. The Ember seems to add 19 times £27, which is £513 a week. The real gain is £513 minus £465 lost on the Alder and £28 on the others: £20 a week, about £1,040 a year, and it pulls customers from a lamp with a better margin.

Line chart of weekly units for Wrenfield Home's table lamps over twelve weeks, invented example data. Before the launch in week 7, the Alder table lamp sells about 30 a week and table lamps in total about 34. After the launch the Ember sells about 19 a week, the Alder falls to about 18, and the category total rises only to about 40, against 37.4 expected from the season alone. Tap or click to open full screen and move around

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 £20 a week, not £513.

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 orderFirst customersBought again within 12 months
Linen tea towel set64036%
Ochre stoneware mug set51033%
Seagrass storage basket38030%
Oak bedside table12021%
Rattan floor lamp29017%
All first time customers6,90028%

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 Priya 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 Wrenfield'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 termSearchesWhat it isFix
bread bin212Not stockedSource and test
doormat148Stocked as "jute mat"Synonym
oven gloves131Stocked as "oven mitts"Synonym
lampshade96Not stocked, only complete lampsSource and test
terracota77Misspelling of terracottaSpelling tolerance

Synonyms and misspellings take an afternoon. Missing products are buying decisions, and the log puts a rough value on them. Wrenfield's searchers convert at 4.1% (GA4, one source for both numbers). If bread bins converted like any searched product:

212×0.041×72=625.82212 \times 0.041 \times 72 = 625.82

So 212×0.041×72≈626212 \times 0.041 \times 72 \approx 626: about £626 of revenue a month from people who already searched, about £325 of gross margin at 52%, close to £3,900 a year, before counting anyone who assumed Wrenfield 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: Wrenfield's four categories

CategoryProductsShare of revenueContribution marginUnits returnedSell throughShare of first orders
Ceramics52031%27%4%64%34%
Kitchen textiles31022%31%2%71%29%
Lamps24027%16%11%48%21%
Small furniture33020%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. Priya 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:

Tap or click to open full screen and move around

Example: Priya's scorecard for January

ProductClassList CTRView to purchase (95% range)Contribution marginReturnsCoverRepeat after first orderDecision
Linen tea towel setAX5.6%4.65% (3.9% to 5.5%)53.7%1%4 weeks36%Keep, never run out, lead product in new customer ads
Ochre stoneware mug setAX4.0%2.87% (2.4% to 3.4%)41%3%5 weeks33%Keep, reorder on forecast
Rattan floor lampAZ9.0%0.21% (0.1% to 0.4%)21.4%14%44 weeks17%Stop reordering, show bulky delivery on the page, review in March
Oak bedside tableBZ3.2%0.35% (0.1% to 0.9%)6%19%60 weeks21%Stop reordering, fix delivery and size facts, move it up the page
Juniper bud vaseCY6.1%10.0% (4.0% to 23.1%)44%2%9 weekstoo fewMore exposure: first row of its category, Shopping
Glazed oval platterCZ2.2%0.8% (0.3% to 2.3%)38%2%120 weekstoo fewMarkdown 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.

If you want a product scorecard like this built on your own shop data, with the queries refreshed every night, book the free workshop: we map your range together, and the first two weeks of work are on me.

Sources

  1. 1.

    Google, Measure ecommerce, Google Analytics developer documentation, checked 22 November 2026, https://developers.google.com/analytics/devguides/collection/ga4/ecommerce

  2. 2.

    Google, [GA4] BigQuery Export schema, Analytics Help, checked 22 November 2026, https://support.google.com/analytics/answer/7029846

  3. 3.

    Google, [GA4] Analytics dimensions and metrics, Analytics Help, item scoped ecommerce metrics, checked 22 November 2026, https://support.google.com/analytics/answer/9143382

  4. 4.

    Edwin B. Wilson, Probable inference, the law of succession, and statistical inference, Journal of the American Statistical Association, volume 22, number 158, pages 209 to 212, 1927; the method as set out in NIST/SEMATECH, e-Handbook of Statistical Methods, section 7.2.4.1 Confidence intervals, National Institute of Standards and Technology, https://www.itl.nist.gov/div898/handbook/prc/section2/prc241.htm

  5. 5.

    Evan Miller, How not to sort by average rating, evanmiller.org, 6 February 2009, https://www.evanmiller.org/how-not-to-sort-by-average-rating.html

  6. 6.

    Solidus, core database schema (spree_line_items, spree_variants, spree_stock_items), migration solidus_one_four, GitHub, checked 22 November 2026, https://github.com/solidusio/solidus/blob/main/core/db/migrate/20160101010000_solidus_one_four.rb

  7. 7.

    Solidus, Spree::LineItem model, set_pricing_attributes, GitHub, checked 22 November 2026, https://github.com/solidusio/solidus/blob/main/core/app/models/spree/line_item.rb

  8. 8.

    Conor Doherty, ABC XYZ analysis (Inventory), Lokad, March 2023, https://www.lokad.com/abc-xyz-analysis-inventory

  9. 9.

    Digital Markets, Competition and Consumers Act 2024, section 226, Misleading actions, legislation.gov.uk, https://www.legislation.gov.uk/ukpga/2024/13/section/226

  10. 10.

    Chartered Trading Standards Institute, Guidance for traders on pricing practices, section 17 on reference prices, Business Companion, updated April 2026, https://www.businesscompanion.info/en/guidance-for-traders-on-pricing-practices

  11. 11.

    Google, [GA4] Enhanced measurement events, Analytics Help, checked 22 November 2026, https://support.google.com/analytics/answer/9216061

  12. 12.

    Sonia Sousa, Search UX: 5 proven strategies for improving "No Results" pages, Baymard Institute, published 4 February 2019, updated 18 February 2025, https://baymard.com/blog/no-results-page

  13. 13.

    Solidus, ProductsController in the Solidus starter frontend, and Spree::Core::Search::Base in Solidus core, GitHub, checked 22 November 2026, https://github.com/solidusio/solidus_starter_frontend/blob/main/templates/app/controllers/products_controller.rb

  14. 14.

    Solidus, migration AddPrimaryTaxonToProducts, released in Solidus 4.5, GitHub, 2025, https://github.com/solidusio/solidus/blob/main/core/db/migrate/20250207104016_add_primary_taxon_to_products.rb