Every example and amount on this page is illustrative. It shows the method and is not a benchmark, a quote or advice.
What Ecommerce Anomaly Detection Actually Measures
An ecommerce anomaly is an unusual deviation from a relevant baseline. The baseline might be the same weekday over recent weeks, the prior month, or a product’s own normal performance. A 33% sales drop—from $12,000 to $8,000—may be an anomaly; it is not automatically a problem. A promotion ending, a stockout, a tracking change, or a seasonal pattern could explain it. The comparison must use the same currency, time window, order status, and metric definition.
Detection answers, “What changed, and by how much?” Diagnosis answers, “Why did it change?” Detection can prioritize a review; it cannot by itself justify changing a price, pausing advertising, or restocking inventory. For example, lower revenue with stable orders points to a lower average order value, while lower orders with stable traffic points to a conversion issue. Those are different investigations.
The metric determines what the signal can reveal. Sales measures realized revenue, so returned and cancelled orders should not inflate the figure. Orders show purchase volume, while conversion rate—orders divided by relevant visits—shows how effectively traffic becomes purchases. Gross margin, calculated as gross profit divided by revenue, shows whether revenue is becoming product profit. Contribution after advertising exposes whether paid growth is economically useful. Customer revenue, repeat behaviour, and customer-level profit can reveal whether the change is concentrated in new, returning, profitable, or loss-making buyers.
For a merchant’s own numbers, ORVX’s financial analytics connects these views: product and collection profitability, gross and net profit, margins, returns, and advertising metrics such as MER and attributed ROAS. Its inventory reporting can also separate a sales anomaly from a stock-position problem through remaining stock value and dead stock. These signals support a focused question—such as whether to investigate traffic, conversion, product economics, customers, or inventory—not a diagnosis that the number alone cannot prove.
| Metric | Can reveal | Cannot prove alone |
|---|---|---|
| Sales | Revenue changed | Why it changed |
| Orders | Purchase volume changed | Whether traffic or conversion caused it |
| Conversion | Traffic-to-order efficiency changed | Whether demand, tracking, or checkout caused it |
| Margin | Profitability per revenue dollar changed | Which cost or product caused the change |
| Customer metrics | Mix, repeat behaviour, or customer profit changed | Whether the next customer will behave the same way |
Build a Baseline You Can Trust
A baseline is trustworthy only when the comparison is like-for-like. Start with the same trading day, not simply the previous calendar date. If your Saturday generates more realised revenue than your Tuesday, comparing them could label normal weekly behaviour as an anomaly. Compare this Tuesday with recent Tuesdays, or use a period that contains the same number of each weekday.
Set the comparison window to match the decision. A one-day baseline catches sudden breaks but is sensitive to one large order. A four-week weekday baseline is steadier, but it can hide a gradual decline. Record which period was used and keep it consistent when checking revenue, gross profit, contribution after advertising, or return rate.
Separate channels before judging the total. If direct revenue is £6,000 versus an expected £5,000 but paid social is £2,000 versus an expected £4,000, the blended result can conceal a channel-specific problem. Also control for product mix: selling 100 low-margin accessories instead of 40 high-margin products can leave revenue unchanged while gross profit falls. A baseline for profitability must therefore use comparable products or collections, not revenue alone. Ecommerce financial analytics should preserve those distinctions.
Promotions change the expected value rather than merely explaining a variance after the fact. Compare a 20%-off campaign with prior promoted periods, or model the promoted products separately. Include stock availability too: a bestseller with only 10 units remaining cannot be fairly compared with a fully stocked day. Inventory position and dead stock are relevant context when interpreting an apparent demand anomaly. Inventory analytics helps keep that context attached to the number.
Finally, check data latency before acting. If orders from today are only 80% synced, £8,000 reported revenue may represent roughly £10,000 once the missing 20% arrives—but that is an estimate, not a confirmed result. Mark incomplete periods as provisional and exclude them from the baseline. Use delivered orders for realised revenue, and keep returns, cancellations, refunds, ad spend, and costs aligned to the same cutoff and trading currency.
The Formula in Plain English
Use two calculations: percentage deviation for business scale, and a z-score for unusualness. Percentage deviation is: (actual − baseline) ÷ baseline × 100. “Actual” is the observed value for the period, such as delivered-order revenue or gross margin. “Baseline” is the comparable expected value established from like-for-like periods. A positive result means performance is above baseline; a negative result means it is below.
The z-score is: z = (actual − mean) ÷ standard deviation. Here, “mean” is the average of the comparable historical observations, and “standard deviation” measures how widely those observations normally vary. A z-score of +2 means the result is two standard deviations above the mean; −2 means it is two below. As a practical screening rule, investigate absolute z-scores of 2 or more, and give scores of 3 or more priority. These are triage thresholds, not proof of a cause or a decision on their own.
Statistical unusualness is not the same as commercial importance. Suppose revenue is $10,200 against a $10,000 baseline, with a standard deviation of $50. The deviation is +2%, but the z-score is +4: statistically unusual, financially only a $200 difference. Conversely, $98,000 against a $100,000 baseline with a standard deviation of $2,500 gives a −2% deviation and a z-score of −0.8. It is less unusual, but the $2,000 shortfall may deserve more attention. Use both measures when reviewing ecommerce financial analytics, and check the underlying metric before acting.
| Measure | What it answers | Direction |
|---|---|---|
| Percentage deviation | How large is the change relative to baseline? | Positive is above baseline; negative is below |
| Z-score | How unusual is the change against normal variation? | Positive is unusually high; negative is unusually low |
A Worked Example: Finding a Margin Anomaly
Consider a Shopify merchant comparing a Tuesday with the previous six comparable Tuesdays. The baseline is 100 expected orders, an average selling price of $60, $24 product cost per order, $6 in other variable costs, and $1,200 in advertising spend.
The baseline arithmetic is: $6,000 in revenue (100 × $60), $2,400 in product cost (100 × $24), and $600 in other variable costs (100 × $6). After subtracting those costs and the $1,200 advertising spend, contribution after advertising is $1,800. On this definition, the contribution margin is 30% ($1,800 ÷ $6,000). The definition matters: gross profit before advertising would be $3,600, or 60% of revenue, so calling either figure “margin” without naming the costs would create a misleading comparison.
Now suppose Tuesday produces 82 delivered orders at the same $60 average selling price, with the same per-order costs and $1,200 in advertising. Realized revenue is $4,920; product cost is $1,968; other variable cost is $492; and contribution after advertising is $1,260. Orders and revenue are each 18% below baseline, while contribution is down $540, or 30%. Contribution margin has fallen to 25.6% ($1,260 ÷ $4,920), a decline of 4.4 percentage points. Advertising has also risen from $12 to $14.63 per delivered order, because the spend did not fall with order volume.
That signal supports a decision to investigate whether demand, campaign efficiency, or the product mix is weakening economics before increasing spend. It does not identify the cause: a lower order count could reflect traffic, availability, or timing, while an unchanged average selling price can conceal a shift toward lower-margin products. A merchant can use ORVX’s financial analytics to examine contribution after advertising by product or collection, and compare MER with attributed ROAS rather than treating either as a complete explanation. The calculation also does not prove that changing a campaign or price will restore margin; it shows where the commercial question is worth investigating.
The Mistakes That Make the Number Wrong
An incomplete order feed can create a false anomaly. Suppose a store normally has 100 delivered orders by midnight, but today’s sync contains only 72 of the 90 orders placed so far. The apparent drop is (72 − 100) ÷ 100 = −28%, but the comparison is not like-for-like. Late Shopify syncs, delayed payment status, and orders still awaiting fulfilment can all change the actual. Treat a current-period alert as provisional until the order window and status data are complete.
Refunds can reverse a revenue or margin signal after the sale is recorded. If gross sales are $12,000 and $1,500 of orders are later refunded, realized revenue is $10,500, not $12,000. A 10% revenue increase based on gross orders may disappear when the refund value is included. Refund timing also matters: matching refunds to the original order date produces a different daily pattern from recording every refund on the day the money leaves the account. Use one consistent rule and label it.
Seasonality can make a normal trading pattern look abnormal. A promotion, payday, holiday, or product launch may shift demand away from the usual weekday pattern. The opposite mistake is allowing one unusual day into the baseline: six comparable days at 100, 102, 98, 101, 99, and 300 orders average 133. The 300-order outlier raises the baseline by 33 orders and can hide a genuine decline. Check the individual observations, not just the average.
Blended channels can conceal the source of the change. Total revenue may be flat at $20,000 while paid social falls from $8,000 to $4,000 and email rises from $2,000 to $6,000. The mix changed even though the store total did not. Attribution-rule changes create a similar problem: attributed ROAS can move when a platform changes its reporting window or credit assignment, without a matching change in store revenue. Compare attributed ROAS separately from MER, which relates total revenue to total advertising spend.
Never add figures from different currencies as if they were one amount. Adding £10,000 and $10,000 produces a meaningless $20,000-style total unless a stated conversion rate and date are used. Keep each trading currency separate; currency conversion itself can also create a movement that is not a demand anomaly.
Finally, an alert can fire before the number is final. A $5,000 morning shortfall may become a $1,000 shortfall after late orders, cancellations, and refunds are processed. Use an early alert as a prompt to verify the data, not as proof that performance changed. ORVX calculates realized revenue from delivered orders and reports refund value against revenue; its ecommerce financial analytics and inventory analytics should still be read with the relevant sync status, order window, currency, and attribution definitions in view.
What to Do When the Signal Is Real
Treat an alert as a prompt to verify, not a diagnosis. Start with the data: confirm the sync completed, the trading window is closed, and the comparison uses the same currency and order status. For a revenue alert, check realized revenue from delivered orders rather than assuming every Shopify order is revenue. Then separate the movement into orders, average selling price, returns, refunds, cancellations and product mix.
Trace the signal down one level at a time. If revenue is 20% below a $12,000 baseline, actual revenue is $9,600, a $2,400 gap. If orders fell from 200 to 160 while selling price stayed at $60, the shortfall is volume. If orders stayed at 200 but average realized price fell to $48, investigate discounts, refunds or product mix. Product and collection profitability can show whether the gap is concentrated in one range; contribution after advertising can show whether paid demand is producing economic value.
Choose the action that matches the verified cause, and define escalation before acting:
A reporting issue: repair or wait for the feed, then recalculate.
A product-level margin decline: fix the economics or reduce exposure; do not judge from revenue alone.
A paid-channel decline: compare MER with attributed ROAS before changing spend, since they answer different questions.
A stock-related pattern: check inventory position, dead stock and remaining stock value before assuming demand disappeared.
Set a threshold in business terms. For illustration only, investigate any realized-revenue deviation below 10%, but escalate to the finance owner when it exceeds 20% and contribution after advertising is negative. The threshold should reflect cash risk, margin and the time available to respond—not a universal statistical rule.
An anomaly can show that a number is unusual; it cannot prove why it changed, that an advertising adjustment caused the change, or that a proposed action will produce a particular result. ORVX reports the store’s numbers and can surface a deterministic recommended action with its reason and confidence, but the operator still validates the cause and decides what to do. See ecommerce financial analytics for profitability context rather than relying on a revenue alert alone.
Anomaly detection is useful when it compares a trustworthy expected value with a clearly defined actual result and connects the gap to a decision. Treat the alert as evidence that something changed, not as an explanation of why it changed; validate the underlying orders, costs, refunds, and timing before changing spend, pricing, inventory, or reporting.