Docs Sales By Country for WooCommerce Country Anomaly Alerts

Country Anomaly Alerts

Country Anomaly Alerts highlight countries whose sales have moved away from their own recent pattern — a sudden spike, an unexpected drop, a market that has gone quiet, or one appearing for the first time.

This feature needs no API key and no AI provider. The detection is a statistical calculation that runs entirely on your own server — no data leaves your site at any point. It is unaffected by the Enable AI Insights setting.

What a "window" is

The window is the date range you have selected on the report. The baseline is the six windows of the same length immediately before it, back to back.

If you select…The window isThe baseline is
Last 7 days7 daysThe 6 preceding 7-day periods — 42 days in total
Last 30 days30 daysThe 6 preceding 30-day periods — about 6 months
This quarterThat quarterThe 6 preceding quarters — about 18 months
Changing the date range changes what counts as an anomaly. A country that looks like a sharp drop over 7 days may be perfectly normal over 90. If the alerts feel too twitchy, widen the date range; if they feel too quiet, narrow it. This also means a store with less than six windows of history behind the selected range has little to compare against, and will show few alerts until it builds one up.

How detection works

Each country is compared against its own recent history rather than against other countries. The plugin builds a baseline from the six preceding windows and measures how far the current window sits from that baseline, as a standard-deviation score.

This matters because it makes the alerts meaningful for small markets too. A country doing a steady handful of orders a week gets flagged when its own pattern breaks — it is not drowned out by your largest markets.

When a country’s baseline is completely flat — the same figure every window, so there is no variation to measure against — a move of 40% or more flags instead.

The four signals

SignalMeaningQualifying rule
SpikeSales well above the country’s recent trend.At least 2.0 standard deviations above the baseline
DropSales well below the country’s recent trend.At least 2.0 standard deviations below the baseline
EmergingFirst sales from this country in the window being examined — nothing in any of the six baseline windows.No prior sales at all
SilentA country that was reliably ordering has stopped.Zero sales this window, after ordering in at least 3 of the 6 baseline windows
"Emerging" here means a country with no prior sales at all, and uses a floor of 5 orders. The Recommendations panel also uses the word "emerging", but for a different job — ranking countries worth acting on — with a lower floor of 3 orders. The two are deliberately separate: one detects a change, the other ranks an opportunity, so a country can appear in one and not the other.

Severity bands

BandWhen it applies
HighThe move is at least 2.5 standard deviations from the country’s baseline.
MediumAt least 2.0 standard deviations from the baseline.
InfoNotable but below the statistical thresholds — for example a brand-new market.

Each alert also carries a short reason in plain language, such as “Sales down 43% vs its 6-period average”, so you can see what triggered it without reading the numbers yourself.

Countries with fewer than five orders in the current window are skipped. Without that floor, normal variation in very small markets would flag constantly.

Where alerts appear

There are two places, and neither of them is your inbox by default.

WhereWhat you seeOn by default?
The report panel at Analytics → Sales by Country, above the chartEvery flagged country for the range you are viewing, with its signal, band and reason. Hides itself completely when nothing is deviating.Yes
An admin notice on WooCommerce admin screensA one-line warning counting high and medium anomalies you have not yet dismissed, linking to the report. Dismissible.Yes
EmailA message to the site admin when a new batch is detected.No — off unless a developer enables it (see below)
No email is sent unless you turn it on. Out of the box, anomaly alerts are on-screen only — the report panel and the admin notice. There is no webhook and no SMS. If you need email, a developer can switch it on with the srbc_anomaly_email_enabled filter.

Detection follows the report filters, so the panel always describes the date range, country type and currency you are currently viewing. Seeing the panel requires view_woocommerce_reports or manage_woocommerce.

Dismissing alerts

The admin notice has a dismiss action that marks the current anomalies as acknowledged. Once dismissed they stop counting toward the notice, and it disappears until a genuinely new anomaly is detected.

Dismissing affects the notice, not the report panel — the panel always reflects the data for the range you are looking at, so it reappears whenever that range contains a deviation. To stop seeing the panel for a country, change the date range or narrow the country filter.

Tuning the thresholds

Developers can adjust the sensitivity with the srbc_anomaly_thresholds filter. It receives an array with these keys and defaults:

KeyDefaultWhat it controls
z_high2.5Standard deviations at or above which an alert is banded High.
z_medium2.0Standard deviations at or above which an alert is banded Medium. Below this, nothing is flagged.
min_orders5Countries with fewer orders than this in the current window are ignored as noise.
baseline_windows6How many preceding windows form the baseline. Minimum 3.
flat_delta40Percentage move that flags when the baseline has no variance at all.
silent_min_active3How many of the baseline windows must have had orders before silence counts as an anomaly.

Raise z_medium and z_high for fewer, more confident alerts; lower them for more sensitivity. Raise min_orders on a store with a long tail of very small markets.

Troubleshooting

ProblemWhat to check
The panel never appearsMost often there is genuinely nothing to report. It also needs history: with fewer than six preceding windows of data, most countries have no usable baseline. Finally, check your user has view_woocommerce_reports or manage_woocommerce.
Too many alertsWiden the date range so each window covers more orders, or raise min_orders and z_medium via the filter.
A country I expected is not flaggedIt may be under the five-order floor for the current window, or its baseline may be variable enough that the move is within two standard deviations.
Alerts look wrong after importing historical ordersThe baseline is rebuilt from whatever is in the Analytics tables. Right after a Past Order Import, earlier windows gain orders they did not have, which legitimately changes what counts as anomalous.
The report feels slower with alerts onDetection queries the six baseline windows in addition to the current one, and results are cached. Narrowing the date range reduces the work on very large stores.