Python
# Run via google-ads-agents CLI
python scripts/gads_anomalies.py \
--customer 123-456-7890 \
--days 30 \
--baseline-days 14 \
--z 2 \
--jsonHow it works
- Takes the mean and standard deviation of spend, CTR, CPC and conversions over a 14-day rolling window.
- Scores each day by its distance from that baseline in standard deviations.
- Flags days where the score passes 2.0, roughly the outer 5% under a normal distribution.
Installation
- Clone repository: git clone https://github.com/arcbaslow/google-ads-agents
- Install dependencies: uv pip install -r scripts/requirements.txt
- Authenticate: python scripts/gads_auth.py --adc
- Run the anomaly command with your customer ID.
Questions
Can this run in CI?
Pass --json and it writes machine-readable output to stdout, which is enough for a GitHub Actions step or a cron job to parse.