Sub topic 15
Setting alerts that catch real problems
An alert is only useful if it fires when something is wrong and stays quiet when it isn't. This chapter assumes you have a daily Search Console table, impression-weighted position, and a 7-day rolling mean and year-over-year comparison like the ones built earlier in this tutorial. It covers how to turn those into alert rules that people keep trusting.
Why most alerts fail
Search data is noisy. Daily clicks swing with the weekday, with seasonality, and with Search Console's reporting delay. An alert like "clicks dropped 20% since yesterday" will fire every Monday after a weekend dip. After a few false alarms, people stop reading alerts, and a real problem gets ignored.
Three habits keep alerts useful:
- Compare against a baseline that already accounts for weekday and season, not against yesterday.
- Require the change to be both large and sustained.
- Alert on segments, not only on the site total, because a loss in one page group can hide behind growth elsewhere.
Choose a baseline
Use the same weekday-aligned comparisons you used for trends. Two baselines work well:
- The trailing 28-day mean of the same weekday. This catches sudden drops.
- The 28-day total compared with the same period one year earlier (364 days back). This catches slow decline and separates it from seasonality.
Ignore the most recent two or three days. Search Console data is still being finalized, so a fresh drop is often a data delay and not a real loss.
Set a threshold and a persistence rule
A threshold says how big the change must be. A persistence rule says how long it must last. Use both.
import pandas as pd
df = pd.read_csv("gsc_daily.csv", parse_dates=["date"])
daily = df.groupby("date")["clicks"].sum().asfreq("D", fill_value=0)
# Drop the last 3 days, which may not be final yet.
daily = daily.iloc[:-3]
# Baseline: mean of the same weekday over the previous 4 weeks.
baseline = sum(daily.shift(7 * k) for k in range(1, 5)) / 4
ratio = daily / baseline
below = ratio < 0.7 # 30% under baseline
# Alert only if 3 days in a row are below the threshold.
alert = below.rolling(3).sum() == 3
print(daily[alert].tail())The ratio test fires on a 30% drop, and the rolling sum requires three consecutive days. A one-day dip no longer triggers it. Tune both numbers against your own history: replay the rule over the past year and count how many alerts it would have sent.
Decide what deserves an alert
Not every metric needs one. A short list works better than a wide one.
| Signal | Why it matters | Suggested rule |
|---|---|---|
| Total clicks | Overall health | 28-day clicks under 85% of last year's, or 3-day drop under 70% of baseline |
| Non-brand clicks | Growth that brand demand does not hide | Same rule, tracked separately |
| Impression-weighted position, key segment | Ranking loss | Worsens by 2 or more positions for 7 days |
| Impressions with stable position | Possible indexing or SERP feature change | Falls more than 30% for 3 days |
| Tracked page with zero clicks | Page may be deindexed or broken | Zero clicks for 3 days after a normal baseline |
From alert to action
Each alert should include the segment, the size of the change, the baseline, and recent annotations, so the reader can start diagnosing at once. Route different severities differently: a chat message for a segment decline, a page for a site-wide collapse. Review the alert log monthly and retire any rule that has never led to action.
Exercise
Your rule alerts whenever daily clicks fall 25% below yesterday, and it fires every Monday. Name two changes that would fix this.
Show answer
Compare against the mean of the same weekday over the previous four weeks instead of yesterday, which removes the weekday pattern. Also require the drop to persist for several consecutive days, such as three, so a one-day dip does not trigger it.
Exercise
A page group averaging 8 clicks per day triggers a "50% drop" alert. What control prevents this, and why?
Show answer
A minimum baseline volume before a segment can alert. With so few clicks, ordinary random variation produces large percentage swings that are not real problems.