Advanced Anomaly Detector
Sends customized Slack and email alerts when metric anomalies are detected across your account, with thresholds and rules defined in a Google Sheet. Supports MCC.
by Charles Bannister (shabba.io)·shabba.io/google_ads_scripts/advanced-anomaly-detector
Overview
Watches account and campaign metrics against rules you set in a spreadsheet (e.g. spend spikes, zero-conversion drift, CTR drops) and fires Slack and/or email alerts when a rule trips. Runs on a single account or across an MCC. Use it as an early-warning system so problems surface in minutes, not at month-end.
Setup
- 1Copy the Google Sheet settings template linked on the source page and define your alert rules.
- 2In Google Ads, open Tools → Bulk Actions → Scripts (MCC-level for multi-account).
- 3Click + to create a new script and paste the code below.
- 4Set INPUT_SHEET_URL. For Slack alerts set SLACK_TEAM_WEBHOOK_URL. Optionally set FOLDER_ID for report storage.
- 5Authorize, preview, then schedule hourly.
Configuration Variables
| Variable | Default |
|---|---|
INPUT_SHEET_URL | YOUR_SPREADSHEET_URL_HERE |
SLACK_TEAM_WEBHOOK_URL | (empty) |
INPUT_TAB_NAME | Anomaly Detector |
FOLDER_ID | (empty) |
ANYONE_CAN_EDIT_SHEETS | false |
Expected Output
Evaluated 14 anomaly rules against last-hour data. ALERT: Campaign "Brand" spend up 210% vs baseline — posted to Slack + emailed. No other rules tripped.
Notes
THIRD-PARTY DEPENDENCY: requires a copied shabba.io settings sheet that drives all rules; the script self-reports run info to shabba by default. Slack alerts need an incoming-webhook URL. Detects MCC vs single-account automatically.