GSC CTR Anomaly Detector
Pulls query-level performance from Search Console and flags queries whose actual click-through rate deviates significan…
Updated
Use this skill
$ npx skills add seoskills.sh/gsc-ctr-anomaly-detectorAbout this skill
GSC CTR Anomaly Detector is a Keyword Research skill for AI agents, published in the seoskills.sh catalog. Reach for it when your work involves keyword discovery, search intent mapping, and topical strategy. Install it with one command and it runs inside your own agent, so the work happens in your workflow, not a separate SEO tool.
SKILL.md
GSC CTR Anomaly Detector
AGENT ROLE: Autonomous CTR-diagnostics agent. Compare each query's real CTR to the position-expected benchmark, flag significant deviations, and emit the JSON in references/output.schema.json.
OBJECTIVE
Find queries that under- or over-perform their position's expected CTR, quantify the click opportunity, and attribute likely cause — so title/meta rewrites are prioritized by impact, not guesswork.
INPUTS
site_url(REQUIRED): verified GSC property (sc-domain:...or URL-prefix).start_date/end_date(OPTIONAL): default last 28 complete days (GSC lag ~3 days; nevertoday).min_impressions(OPTIONAL, default 100): demand floor to suppress noise.deviation_sigma(OPTIONAL, default 2.0): robust-z threshold on the CTR residual.ctr_curve(OPTIONAL): a property-specific position→CTR curve; defaultreferences/ctr_curve.json.
AUTHENTICATION (Search Console API)
- REQUIRE
GOOGLE_APPLICATION_CREDENTIALS(SA) OR OAuth, scopehttps://www.googleapis.com/auth/webmasters.readonly.- IF absent THEN STOP
error.code="AUTH_MISSING_CREDENTIALS".
- IF absent THEN STOP
- Identity MUST be a verified user on
site_url. IF403THEN STOPerror.code="AUTH_NO_SITE_ACCESS". - Endpoint:
POST https://searchconsole.googleapis.com/webmasters/v3/sites/{urlEncoded}/searchAnalytics/query.
EXPECTED TOOL CALLS
- Run
scripts/ctr_anomaly.py --site {site_url} --min-impr {n} --sigma {x}. - Query with
dimensions=["query","page"],dataState="final", paged viastartRow.
PROCEDURE (deterministic)
STEP 1 — FETCH query/page rows (paged).
STEP 2 — FILTER to impressions >= min_impressions.
STEP 3 — For each row: expected_ctr = curve[round(position)]; residual = actual_ctr − expected_ctr.
STEP 4 — Build the residual distribution across all rows; compute robust center (median) + MAD; robust_z = (residual − median) / (1.4826*MAD).
STEP 5 — FLAG:
underperformerIFrobust_z <= −deviation_sigma→opportunity_clicks = round(impressions * (expected_ctr − actual_ctr))(positive).overperformerIFrobust_z >= +deviation_sigma→ study as a winning title/meta pattern to replicate. STEP 6 — ATTRIBUTE (heuristic, per underperformer): fetch the page's<title>/meta description (≤1 GET, honor robots); IF the query's head terms are absent from the title THEN cause hinttitle_mismatch; IF position ≤ 3 but CTR low AND the SERP likely has features THENserp_feature_suppression; elseweak_snippet. STEP 7 — EMIT underperformers sorted byopportunity_clicksdesc; include a smalloverperformerslist.
RATE LIMITS & ERROR HANDLING
- GSC:
429/RESOURCE_EXHAUSTED→ backoff2^attempt(max 5) then STOPerror.code="RATE_LIMITED". - Only trust
finaldataStaterows. - On-page title fetch failure →
cause="unknown"for that row; never block the run.
MISSING / INSUFFICIENT DATA
- IF 0 rows above
min_impressionsTHENstatus="no_data", empty arrays, no error. - IF
position > 20THEN clamp expected_ctr to the 20+ bucket; do not extrapolate. - Residual stats require ≥ 30 rows for stability; below that set
confidence="low"and widen sigma by +0.5.
OUTPUT
One JSON object per references/output.schema.json. No prose.
FILES
scripts/ctr_anomaly.py— GSC client, residual + robust-z scoring, cause attribution.references/ctr_curve.json— position→expected-CTR benchmark.references/output.schema.json— output contract.
Not using the CLI? Copy the SKILL.md and paste it straight into ChatGPT, Claude, or any agent.
Embed a badge
Install into your agent
More in Keyword Research
find-keywords
Build a prioritized keyword list for a website, topic, or campaign. Use when the user asks about keyword research, finding keywords to target, building a keyword list, search demand, keyword difficulty, intent mapping, or which keywords to prioritize. For writing content around keywords, see brief. For grouping keywords into clusters, see build-clusters.
seo-plan
Strategic SEO planning for new or existing websites. Industry-specific templates, competitive analysis, content strategy, and implementation roadmap. Use when user says "SEO plan", "SEO strategy", "SEO planning", "content strategy", "keyword strategy", "content calendar", "site architecture", or "SEO roadmap".
seo-cluster
SERP-based semantic topic clustering for content architecture planning. Groups keywords by actual Google SERP overlap (not text similarity), designs hub-and-spoke content clusters with internal link matrices, and generates interactive visualizations. Optionally executes content creation if claude-blog is installed. Use when user says "topic cluster", "content cluster", "semantic clustering", "pillar page", "hub and spoke", "content architecture", "keyword grouping", or "cluster plan".
seo-sxo
Search Experience Optimization: reads Google SERPs backwards to detect page-type mismatches, derives user stories from search intent signals, and scores pages from multiple persona perspectives. Identifies why well-optimized pages fail to rank by analyzing what Google rewards for each keyword. Use when user says "SXO", "search experience", "page type mismatch", "SERP analysis", "user story", "persona scoring", "why isn't my page ranking", "intent mismatch", or "wireframe".
target-serp
Identify and capture SERP features for target keywords — featured snippets, People Also Ask boxes, knowledge panels, and rich results. Use when the user asks about featured snippets, position zero, PAA optimization, rich results, schema markup for SERP features, or how to get more SERP real estate.
amazon-keyword-research
Amazon keyword research and market opportunity analysis for sellers. Retrieve autocomplete suggestions (long-tail keywords), analyze competitor landscape, and assess market opportunity for any keyword on 12 Amazon marketplaces (US/UK/DE/FR/IT/ES/JP/CA/AU/IN/MX/BR). No API key required. Make sure to use this skill whenever the user mentions Amazon product research, finding products to sell on Amazon, Amazon keyword ideas, niche analysis, competition analysis for Amazon, market opportunity on Amazon, comparing Amazon keywords, evaluating whether a product is worth selling, Amazon autocomplete da