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.
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 is | The baseline is |
|---|---|---|
| Last 7 days | 7 days | The 6 preceding 7-day periods — 42 days in total |
| Last 30 days | 30 days | The 6 preceding 30-day periods — about 6 months |
| This quarter | That quarter | The 6 preceding quarters — about 18 months |
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
| Signal | Meaning | Qualifying rule |
|---|---|---|
| Spike | Sales well above the country’s recent trend. | At least 2.0 standard deviations above the baseline |
| Drop | Sales well below the country’s recent trend. | At least 2.0 standard deviations below the baseline |
| Emerging | First sales from this country in the window being examined — nothing in any of the six baseline windows. | No prior sales at all |
| Silent | A country that was reliably ordering has stopped. | Zero sales this window, after ordering in at least 3 of the 6 baseline windows |
Severity bands
| Band | When it applies |
|---|---|
| High | The move is at least 2.5 standard deviations from the country’s baseline. |
| Medium | At least 2.0 standard deviations from the baseline. |
| Info | Notable 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.
Where alerts appear
There are two places, and neither of them is your inbox by default.
| Where | What you see | On by default? |
|---|---|---|
| The report panel at Analytics → Sales by Country, above the chart | Every 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 screens | A one-line warning counting high and medium anomalies you have not yet dismissed, linking to the report. Dismissible. | Yes |
| A message to the site admin when a new batch is detected. | No — off unless a developer enables it (see below) |
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:
| Key | Default | What it controls |
|---|---|---|
z_high | 2.5 | Standard deviations at or above which an alert is banded High. |
z_medium | 2.0 | Standard deviations at or above which an alert is banded Medium. Below this, nothing is flagged. |
min_orders | 5 | Countries with fewer orders than this in the current window are ignored as noise. |
baseline_windows | 6 | How many preceding windows form the baseline. Minimum 3. |
flat_delta | 40 | Percentage move that flags when the baseline has no variance at all. |
silent_min_active | 3 | How 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
| Problem | What to check |
|---|---|
| The panel never appears | Most 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 alerts | Widen 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 flagged | It 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 orders | The 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 on | Detection 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. |