Anomaly Detection in Google Ads: Choosing the Baseline
Compare each day against the same weekday over the previous four weeks, not against the day before. Combine a percentage threshold with an absolute floor, and skip entities too new to have a baseline instead of treating an absent baseline as zero.
Every anomaly alert is a comparison, and the comparison is the whole design. Get the baseline wrong and the script produces an email every Monday and every Saturday until somebody makes a filter rule for it. After that the alert exists but does nothing, which is worse than not having it, because it feels like coverage.
Why yesterday against the day before fails
Almost every account has a weekly shape. B2B collapses at the weekend; consumer services peak on Sunday evening; anything tied to office hours has a hard Friday edge. Comparing Monday to Sunday in such an account produces a large difference every single week, and none of it is news.
The fix is one line of design: compare a day to the same weekday over the previous few weeks. Monday against the last four Mondays. The weekly pattern cancels out and what remains is movement worth reading.
Choosing the baseline window
| Window | Behaviour | Suits |
|---|---|---|
| Same weekday, last 4 weeks | Removes weekly shape, adapts within a month | Most accounts. Sensible default. |
| Same weekday, last 8 weeks | More stable, slower to accept a new normal | Low volume accounts where four points are noisy |
| Trailing 7 day average | Simple, but carries the weekly shape | Accounts with genuinely flat weekly patterns only |
| Same period last year | Captures seasonality, ignores everything since | Strongly seasonal accounts, as a second check |
Four same-weekday points is the practical default. It is enough to average without being so long that a deliberate change six weeks ago still counts as normal.
Thresholds, floors and the noise problem
Use a percentage threshold plus an absolute floor. A campaign that moved from two units to five is up 150 per cent and matters to nobody. The floor removes the entire class of small-campaign noise without touching the sensitivity of the alert on campaigns that matter.
Start loose. Forty per cent, tightening to twenty-five once you have seen a month of output. A new alert should under-report; you can always raise sensitivity after you trust it.
Skip entities without a baseline. A campaign launched last week has no four Mondays behind it. Report it as new rather than as an anomaly, or skip it entirely. Treating an absent baseline as zero produces an infinite percentage change, which is how alert systems lose credibility on their first week.
Account spend flat with one campaign doubling and another collapsing shows nothing at the account level. Run the comparison per campaign and aggregate the alerts, rather than comparing one account number against another.
Metrics worth watching, in order
- Spend by campaign. Moves first and covers most real failures.
- Conversions with spend continuing. The classic signature of broken tracking, and the most expensive failure to notice late.
- Impressions at campaign level. Catches disapprovals, budget exhaustion and policy suspensions.
- Cost per conversion. Useful but derived, so it moves for reasons the first three already told you about.
Zero conversions with spend running is worth a separate rule with no percentage threshold at all. It is either a real emergency or a tracking failure, and both need the same phone call.
Making the alert usable
An anomaly email should answer three questions in its first line: what moved, by how much against what, and whether it is still happening. Everything else is detail below the fold.
Send nothing when there is nothing to report, but check the run history occasionally — with silent-when-clean alerts, a script that has been failing for three weeks looks exactly like an account with no problems.
The implementation is the spend anomaly alert.
Questions
- Why does my spend alert fire every Monday?
- Because it compares yesterday to the day before, and most accounts have a weekly pattern. Compare each day to the same weekday over the previous four weeks instead.
- What threshold should an anomaly alert use?
- Start at forty per cent with an absolute cost floor so small campaigns cannot trigger it, then tighten toward twenty-five per cent once you have seen a month of output.
- How should a script treat a brand new campaign?
- Skip it or label it as new. It has no baseline, and treating a missing baseline as zero produces an infinite percentage change that discredits the alert.
- Which metric is most worth alerting on?
- Spend by campaign moves first and covers most real failures. A separate rule for spend continuing with zero conversions catches tracking breakage, which is the most expensive thing to notice late.