Recommended Free Tools
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Use a seasonality-aware model to flag unusual Google Keyword Planner volume months for review—not to delete them automatically. Preserve the original values and the targeting context, then use robust STL to separate trend, annual seasonality, and residual variation in a sufficiently long, regular monthly series.
What a Google keyword-volume spike means
Google Ads historical metrics are estimates, not a census of exact searches. The API provides approximate monthly search volumes for up to four years, alongside an average-monthly-searches field. Google says it updates search-volume metrics monthly using the preceding month’s search data. See Google Ads API: Generate historical metrics.
A peak may be a real seasonal surge, a sustained change in demand, a short-lived event, a change in measurement context, or faulty source data. A detector can identify an observation that differs from a model; it cannot determine which explanation is correct.
The measurement context matters. Google Ads Help defines average monthly searches in relation to the selected date range, location, and Search Network settings, and says the count includes close variants. Do not combine series as if they measure the same thing when geography, language, network, date range, or keyword identity differs. Historical volume also is not a forecast: Google’s forecast documentation says forecasts account for bid, budget, seasonality, and historical ad quality, while historical search-volume statistics do not. See Google Ads Help: About Keyword Planner forecasts.
#1 Best Overall
Prepare the data before cleaning
Keep the extraction and its context
Retain an untouched copy of each export. Alongside each value, record its source (Keyword Planner UI or API), extraction date, requested and returned keyword text, close variants if supplied, month, location, language, Search Network, and requested date range. Preserve currency and bid fields when they are part of the export, but do not treat them as search-volume inputs.
The API may deduplicate close variants and return them in a close_variants field. Keep that information with the series so later comparisons do not silently change what a keyword row represents. Google’s historical-metrics documentation describes the field and request context; its Python sample for generating historical metrics shows how to request and read monthly values with language and geographic targeting.
Rank #2
Align rows and inspect gaps
- Compare or concatenate only series with aligned keyword identity, geography, language, network, and time range.
- Normalize month labels to a monthly date index, sort chronologically, and check duplicate keyword-month-context keys.
- Inspect missing and non-numeric values, and plot the series. A one-month jump that reverses is different from a higher level that persists.
- Treat an absent month as missing, not as zero. The reviewed Google documentation describes approximate volume estimates but does not establish that a missing export row means zero searches.
Use robust STL to account for trend and seasonality
For a sufficiently long, regularly spaced monthly history, STL can help distinguish a recurring annual pattern from an unusual residual. Statsmodels describes STL as decomposing a series into trend, seasonal, and residual components; its robust option reweights observations so the fit can tolerate some large errors. For monthly data, set the seasonal period to 12 explicitly, especially if the index has no frequency metadata. See statsmodels: Seasonal-Trend decomposition using LOESS (STL).
Adapt this workflow illustration to your export’s column names. It deliberately stops if months are missing rather than silently filling them:
import pandas as pd
from statsmodels.tsa.seasonal import STL
# df columns: keyword, month, searches, geo, language, network
series = (
df.loc[df["keyword"].eq("example keyword")]
.sort_values("month")
.set_index("month")["searches"]
.astype(float)
)
series.index = pd.to_datetime(series.index)
series = series.asfreq("MS") # inspect gaps; do not assume a gap is zero
# Resolve missing months deliberately before fitting.
if series.isna().any():
raise ValueError("Resolve or explicitly handle missing months before STL")
fit = STL(series, period=12, robust=True).fit()
components = pd.DataFrame({
"observed": series,
"trend": fit.trend,
"seasonal": fit.seasonal,
"resid": fit.resid,
"robust_weight": fit.weights,
})
Do not interpolate across a suspected spike just to make the model run. Missing-data handling depends on why the observation is absent; document the choice or exclude a short or incomplete series. Statsmodels’ examples include forward-filling in one sample dataset, but that is not a universal rule for keyword volumes. See the statsmodels STL example.
Flag unusual residuals, then investigate
After fitting STL, a large absolute residual can be used as a review flag. One transparent screening option is to compare residuals with a robust scale such as the median absolute deviation (MAD). This is a proposed heuristic, not a Google or statsmodels threshold: neither source prescribes a universal cutoff or replacement rule. Choose and document a threshold appropriate to your data, and check whether conclusions change under other reasonable thresholds.
For each flagged month, check the original export and the surrounding context:
Free tools Windows power users keep installed
One-click scans. No signup required.
- Does the peak recur in the same season in other years?
- Do related keywords move at the same time?
- Does the increase persist, suggesting a level shift rather than a one-off observation?
- Did the targeting, keyword matching, export, or collection settings change?
A repeatable seasonal peak or persistent rise is evidence to retain the change as demand. A lone, uncorroborated point may merit correction, but only after source-level investigation. If you cannot verify that a value is wrong, leave it intact and label it as a potential anomaly.
Best Value
Choose a screening method that fits the question
| Method | Trend handled? | Seasonality handled? | History and sensitivity | Best use |
|---|---|---|---|---|
| Visual review and context checks | Analyst judges the pattern | Analyst can recognize recurring peaks | Interpretable, but less scalable | Essential review for any flagged month |
| Robust STL residual review | Yes, via the trend component | Yes, when a recurring seasonal pattern can be estimated | Needs a sufficiently long, regular series and deliberate gap handling; flags do not prove error | Monthly data with enough history to estimate an annual cycle |
| Global z-score or fixed cap | No, not by itself | No, not by itself | Easy to apply, but can mark real peaks or trend changes as outliers | Not a good default for seasonal keyword histories |
| Rolling median/MAD screening | Partly, by comparing locally | Not automatically | Window and threshold are judgment calls; validate against known seasonal behavior | Lightweight local anomaly flags |
Keep raw values and edits auditable
Never silently overwrite the exported values or describe a cleaned series as the true search volume. If a value is confirmed erroneous, keep fields such as searches_raw, searches_clean, is_flagged, and correction_reason, together with the source provenance. Treat the result as a reviewed or adjusted analytical series and disclose the rule used.
For API workflows, Google’s Keyword Planning documentation recommends caching or storing results; responses may remain consistent for hours or days, while historical metrics refresh monthly. Take consistent snapshots and retain extraction metadata so a refresh can be distinguished from a targeting change. Check the API version used by your client when adapting Google’s Python sample.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errors

