CPC Spike Alert
Compares yesterday's average CPC per campaign against its 30-day baseline and alerts on spikes — the earliest visible symptom of a new competitor, broad-match drift, or a bid change gone wrong.
by Dmytro Tonkikh·chiliad.io
Overview
A sudden CPC jump is the earliest visible symptom of several expensive things: a competitor entering the auction, broad match drifting into pricier queries, a bid target change gone wrong, or seasonality arriving early. CPC Spike Alert compares yesterday's average CPC per campaign against its trailing 30-day baseline and emails when any campaign exceeds the baseline by your spike factor — with the estimated extra cost quantified. Catching it the next morning costs one email; catching it in the monthly report costs a month of expensive clicks.
Setup
- 1Open your Google Ads account and go to Tools → Bulk Actions → Scripts.
- 2Click the + button to create a new script and paste the code below.
- 3Adjust SPIKE_FACTOR (1.5 = 50% above baseline) and MIN_CLICKS to your volume.
- 4Set EMAIL_ADDRESS — this script exists to be a morning alert.
- 5Preview once to verify, then schedule daily (early morning).
Configuration Variables
| Variable | Default |
|---|---|
SPIKE_FACTOR | 1.5 |
MIN_CLICKS | 20 |
EMAIL_ADDRESS | (empty) |
Expected Output
[OK] Brand — Exact - yesterday CPC 0.42 vs baseline 0.39 === CPC Spike Alert (yesterday vs 30-day baseline) === Campaigns checked: 12 Spikes: 1 Generic — Broad yesterday CPC: 2.84 baseline: 1.61 (x1.8, ~412.30 extra on 335 clicks) Email sent to you@example.com
Notes
Low-click campaigns produce noisy CPCs — the MIN_CLICKS filter is what keeps this alert trustworthy; raise it if you get false alarms. When it fires, check in order: Auction Insights, the search terms report, recent bid/target changes, then the calendar.