Analyze with AI

Get AI-powered insights from this Mad Devs article:

Your vendor dashboard shows sales after shoppers click recommended products. The number looks encouraging, but your team still has to decide whether to replace the current model or expand its rollout. Some shoppers might have bought those products anyway; others might have switched from a more profitable item already in their cart.

Measuring an ecommerce recommendation engine starts with a comparison that matches that decision. You need to know what changes across the whole order when eligible shoppers receive the new experience. This guide gives you a practical framework for choosing that comparison, connecting exposure to purchases, and deciding whether the evidence supports scaling, another iteration, or stopping.

Key takeaways

  • Attribution records a recommendation touchpoint. A randomized experiment estimates the additional business outcome caused by assigning the experience.
  • Choose the baseline, primary metric, and guardrails before launch. A replacement model should compete against the current logic.
  • Connect assignment and actual impressions to complete orders, including returns and products outside the widget.
  • Scale when the estimated benefit, uncertainty, margin protection, and data quality support the decision. An inconclusive result needs a defined next step.

Separate attributed revenue from incremental lift

Attributed revenue counts purchases connected to recommendations under a reporting rule, such as a click followed by an order within a defined window. It tells you where recommendations appeared in a purchase journey. That connection alone cannot establish how much additional revenue they created.

The counterfactual question is: what would comparable shoppers have purchased under the alternative experience? Random assignment provides a way to estimate that difference across groups. Comparing recommendation clickers with nonclickers does not: their purchase intent can differ before either group sees the widget.

In a randomized field experiment by Kumar and Hosanagar, substitute recommendations on a fashion retailer's product pages affected both recommended products and the product hosting the links. Recommended substitutes gained sales while the focal product's sales conditional on a page view declined. The study illustrates why individual SKU gains can hide redistribution. Its findings do not predict the effect at another retailer.

Apply that distinction to your reporting request: ask for total revenue across the assigned population alongside recommendation-attributed revenue. A widget can earn more attributed sales by redirecting existing demand. The experiment needs to capture the combined outcome, including purchases that never involve a recommendation click.

Choose the baseline before running the experiment

The baseline defines the question your experiment answers. Select it from the experience the business would otherwise keep or deploy.

Current engine or merchandising logic. Use this when deciding whether to replace an existing system. Treatment receives the proposed model; control retains the current strategy. Preserve the surrounding experience wherever possible so that a layout redesign or different discount policy does not become an unacknowledged part of the treatment.

Simple rules. A bestseller list, category match, or manually maintained selection can be a useful comparator when the decision is whether model complexity earns its additional cost. Document the rules and refresh schedule. A neglected baseline makes a weak investment benchmark.

No recommendations. This answers whether adding recommendations improves the existing shopping experience. Specify what happens to the vacated space. Removing an entire module can change page layout and navigation, making the tested intervention broader than ranking logic alone.

For a hypothetical retailer replacing its current engine, beating an empty page section would leave the replacement question unanswered. The incumbent remains the relevant alternative even if it has obvious limitations.

Before launch, write a one-sentence hypothesis naming the audience, placement, change, and expected business outcome. Define eligibility before treatment can influence it. For example, randomize when a shopper reaches an eligible product page, provided neither variant has affected the journey to that page. Keep the placement and number of slots consistent when isolating a ranking change. If the proposed production package also changes those elements, explicitly test and describe the package. Archive both configurations so reviewers can reconstruct what shoppers actually received.

Instrument the path from assignment to purchase

Assignment records who was allocated to each variant. Eligibility records whether a shopper qualifies for the experiment. An impression records what was actually displayed. Keep these concepts separate: receiving an assignment does not guarantee that the recommendation module loaded or entered the viewport.

Capture the experiment and variant identifiers, assignment time, and stable shopper identifier. At each eligible opportunity, record the placement, strategy or model version, displayed SKUs, and their positions. Define an impression consistently, then capture actual impressions, clicks, cart additions, purchases, cancellations, and returns. Preserve timestamps and identifiers that connect those events without relying on a click as the only bridge to an order.

The assignment must persist across visits within the test's identity rules. Decide what happens when an anonymous visitor signs in, uses another device, or loses a cookie. Quantify unresolved identity changes rather than assuming every browser represents a different customer.

Link orders back to assigned shoppers and retain every basket line, quantity, price, and discount. Record return adjustments against the original order. This supports an outcome that includes an unclicked accessory, an abandoned substitute, or a later purchase within the agreed observation window.

Validate the chain with controlled test journeys before opening traffic. Follow an eligible shopper in each variant through a purchase and refund. Reconcile purchase events with the order system; check duplicate order IDs, missing impressions, event delays, and cases where the assigned variant differs from the strategy served. Compare event completeness across groups.

Keep the primary analysis based on assignment within the predefined eligible population. Restricting it to shoppers who clicked or saw a successful render can select people differently in each variant. Use impression and delivery diagnostics to explain failures. Microsoft's guidance on sample ratio mismatch also shows why unexpected group counts require investigation before effect estimates are trusted.

Measure revenue alongside contribution margin

Choose one primary metric before viewing results. Revenue per eligible randomized user is a practical option: divide all qualifying order revenue in the observation window by all eligible users assigned to that variant, including nonbuyers. Use the same eligibility rules and observation window in both groups.

Define revenue precisely. State whether it excludes tax and shipping, how discounts reduce it, and how cancellations and returns adjust it. Keep late adjustments visible through a planned reconciliation date. A gross-sales reading and a returns-adjusted reading answer different economic questions.

Estimate incremental revenue per user as treatment revenue per user minus control revenue per user. Report the absolute difference and its uncertainty; a relative percentage needs the control value as its denominator. Multiplying by a future eligible population is a scenario projection whose assumptions about traffic, inventory, and behavior need to be stated.

When cost data is available, make contribution margin per eligible user an economic guardrail. Agree with finance which variable costs belong in it, such as merchandise cost, payment fees, fulfillment, and return handling. Apply that definition consistently. A hypothetical shift toward heavily discounted products could increase revenue while reducing contribution margin. Set the acceptable deterioration threshold before launch.

Use conversion rate and average order value to explain how the outcome moved. Higher order value can accompany fewer purchasers, so either metric alone leaves the overall result unresolved. Monitor discount depth, cancellations, returns, stock availability, and sales redistribution between SKUs. Check whether promoted products displaced higher-margin alternatives elsewhere in the basket.

CTR and dashboard-attributed revenue remain useful diagnostics for discovery and engagement. They do not establish an incremental business benefit. Microsoft's experimentation metric taxonomy similarly separates feature diagnostics from overall outcomes, guardrails, and data quality checks. Keep model development and ongoing operating costs in a separate investment calculation; experimental revenue lift is not net profit.

Check whether the experiment can detect the effect

Randomize an appropriate unit, usually a stable shopper or account, and retain its assignment throughout the experiment. Analyze uncertainty at that unit rather than treating every visit or order as independent. If shared accounts or other dependencies are material, have the analyst adapt the design before launch.

Run treatment and control concurrently. This gives both groups exposure to the same calendar conditions, although it does not remove every risk. Record promotions, inventory constraints, marketing changes, and overlapping experiments. Coordinate tests that change the same placement or explicitly plan how to analyze their interaction.

Set a minimum detectable effect, or MDE, that represents a commercially meaningful change. Ask the analyst to calculate the required sample using historical user-level revenue variability, the planned allocation, significance threshold, and statistical power. Revenue includes many zero-spend users and occasional large orders; a conversion-only calculator may poorly represent its sensitivity. Microsoft's pre-experiment guidance connects power planning to the affected population and highlights the limitations of unstable identifiers.

Translate the required users into a feasible recruitment period using eligible traffic rather than total site visits. Add the observation time needed to capture the purchase cycle and planned returns adjustment. There is no universal test duration or holdout percentage. A short promotional period may answer a promotional question while leaving ordinary trading conditions untested.

Predefine the stopping and analysis rules. Repeatedly checking a conventional significance test and stopping at the first favorable result can invalidate its error guarantees. Use the planned endpoint or an appropriate sequential method. Set separate safety rules for severe commercial or technical harm.

Plan a small number of decision-relevant segments in advance, such as new versus returning shoppers. Check their available sample sizes and account for multiple comparisons when making confirmatory claims. A promising segment discovered afterward is a hypothesis for another test.

With limited traffic, narrow the hypothesis or accept that only larger effects are detectable. Extending a test helps only while the experience and business conditions remain interpretable. Before/after comparisons can inform diagnosis, but changing demand and promotions weaken causal attribution. If the uncertainty still spans meaningful benefit and harm, report that the experiment has not resolved the decision.

Turn the result into a scale, revise, or stop decision

Use the decision rules agreed before launch. Start by verifying assignment, event coverage, and metric reconciliation. A favorable estimate from broken data is insufficient for rollout. Read the estimated effect together with its confidence interval, commercial threshold, and guardrail results.

The matrix below is a proposed working aid. “Increased” should mean evidence that meets your predefined standard, with an interval narrow enough to support the decision.

ResultNext step
Revenue and contribution margin increased; guardrails heldConsider a controlled rollout.
Revenue increased; margin deterioratedInvestigate discounts, product mix, and cannibalization.
Effect remains uncertainContinue under a valid extension plan, repair instrumentation, or reconsider the MDE for a future test.
Result is negativeCheck coverage, data quality, eligibility, and baseline behavior before considering wider exposure.

Do not keep extending an inconclusive experiment until it produces a favorable answer. Distinguish insufficient information from an estimate that rules out the benefit needed to justify the project. Repairing broken measurement may require restarting the test. Changing the MDE after seeing results cannot retroactively strengthen its evidence.

For an unfavorable result, investigate delivery failures and configuration mistakes. If those checks pass, accept that the tested package may perform worse and stop or revise it. A higher CTR does not override a revenue or margin loss.

For a positive result, expand exposure in controlled steps with monitoring and rollback ownership. Avoid assuming the estimate covers new audiences or trading conditions.

Finally, compare expected contribution gains with development, integration, inference, monitoring, and support costs over an explicit investment horizon. Keep that business case separate from the experimental lift estimate and disclose assumptions behind any payback calculation.

What Mad Devs’ ecommerce recommender test can and cannot show

Mad Devs' published account of recommender system development describes an ecommerce project involving purchase data, customer grouping, and a recommendation system. The team reports migrating data from 1C into a warehouse and working with purchase patterns to inform recommendations and promotions.

The account also describes practical data problems: losses during migration and loyalty cards used by more than one shopper. Those details make the experience relevant to measurement preparation. A card identifier needs validation before it is treated as an individual customer, and incomplete purchase history needs reconciliation before it supports an analysis.

The article says the team conducted A/B tests and reports commercial improvements. Its public description does not specify the control experience, randomization procedure, metric definitions, or sample size. It also does not disclose the uncertainty needed to assess the reported differences. The published figures therefore cannot establish incremental revenue for the framework presented here.

This is evidence of Mad Devs' implementation experience, with limits on what readers can infer about causality. A measurement case study would additionally need an agreed observation period, treatment and control definitions, discount and return handling, and the analysis plan. Until those details are available, the useful lesson is to validate data and identity assumptions before interpreting an outcome.

Prepare a pre-launch measurement spec

Copy this template into the experiment ticket and complete it with product, analytics, engineering, and finance. Treat it as a proposed working agreement: every field should identify a concrete configuration, definition, or decision owner.

FieldWhat to record
HypothesisThe proposed change, audience, and expected outcome.
Baseline / treatmentThe alternative and new strategy, including versions and placement.
Assignment / eligibilityWho participates, the assignment unit, and persistence rules.
Primary metric / guardrailsThe outcome definition and acceptable deterioration limits.
Event coverageHow assignment, impressions, baskets, orders, and returns connect.
MDE / sample plan / durationRequired sensitivity, recruitment, observation window, and stopping method.
Decision ruleThe evidence required to scale, revise, or stop.

Have the owners resolve ambiguous definitions before enabling traffic. Store the approved version with the experiment results so later reviewers can distinguish planned decisions from exploratory findings.

Conclusion

Before expanding your ecommerce recommendation engine, ask the team to approve a measurement spec and demonstrate that the event chain works. That creates a concrete starting point for the experiment and exposes gaps while they are still inexpensive to fix.

The next decision should follow the evidence available for the tested audience and experience. A credible positive estimate can support controlled expansion; unresolved uncertainty calls for a defined learning step. When the result cannot justify the required investment, revising or stopping is useful progress. The purpose of measurement is to make that choice defensible before wider exposure commits more resources.

AI & Machine Learning
Build a recommender around your product data
Mad Devs can validate the use case, integrate the model, and support its rollout.
Talk to our ML team

Latest articles here

Headless and traditional commerce storefronts connected to one commerce backend

Headless Commerce vs. Traditional Commerce: When to Rebuild the Storefront

Imagine a Shopify store where customers can buy individual products, but cannot yet build their own discounted bundle. The team wants shoppers to...

Two payment gateways connected through a routed transaction flow

Multiple Payment Gateway Integration: How to Add a Second Provider

Your store is preparing to sell in another market, but its existing payment connection does not meet the new checkout requirements. You already need...

Conveyor motor and bearing visualization for predictive maintenance with machine learning

Predictive Maintenance With Machine Learning: Choosing a Failure Target and Validating Early Warnings

An industrial software provider wants to add failure warnings to equipment dashboards that already collect telemetry. Its CTO and the customer's...

Go to blog