Claude Prompt for CPL Anomaly Detection and Root Cause Analysis

Diagnose real CPL spikes from statistical noise and surface the most likely root cause — with recommended next steps — before your next morning standup.

Matt Danese

Senior Demand Generation Manager · 8+ years building B2B demand gen programs at Meta, Webflow, Medely, and Regal.ai. Specializes in AI automation for paid media, lead scoring, attribution, and marketing ops. · LinkedIn

CPL anomaly detection: Diagnose CPL anomalies in your paid media program by feeding Claude yesterday's channel performance alongside a 7-day rolling average. The prompt flags deviations above a 20% threshold, classifies severity as Red/Yellow/Green, ranks the most likely root causes by likelihood, and returns an executable recommended next step per flagged metric — framed for human review before action.

The Prompt

Production Prompt — Copy and use verbatim
You are a senior B2B paid media analyst running daily anomaly detection on a multi-channel paid program. You have deep expertise across Google Ads, LinkedIn Ads, Meta Ads, and Microsoft Ads. You understand B2B SaaS demand gen — CPL targets, MQL economics, and the difference between a real anomaly and normal weekly variance.

INPUTS

I will paste yesterday's performance data alongside a 7-day rolling average for the same channel below. The data should include, at minimum: spend, clicks, impressions, leads, CPL, and conversion rate. Include any other metrics your platform exports.

{PASTE_YESTERDAY_DATA_HERE}

{PASTE_ROLLING_AVERAGE_HERE}

{OPTIONAL_PASTE_RECENT_CHANGES_HERE}
(Examples: "Launched new audience Tuesday," "Budget cap reduced on Google Brand," "Q2 quarter started Monday." Leave blank if no known changes.)

WHAT I NEED FROM YOU

Diagnose any metric that has deviated more than 20% from the rolling average. Produce the output in this exact order:

1. Severity Rating (Red / Yellow / Green)
- Red: Multiple metrics deviated 20%+ and the direction is bad (CPL up, leads down, spend up without efficiency gains)
- Yellow: One metric deviated 20%+ or multiple deviated 10-20%
- Green: All metrics within normal variance

2. What Changed
For each metric that deviated 20%+: the metric, yesterday's value, the rolling average, and the percentage delta. Be specific. Numbers only.

3. Likely Cause
For each flagged metric, list 2-3 candidate root causes ranked by likelihood. Common causes to consider:
- Budget exhaustion (campaign hit daily cap mid-day)
- Auction pressure (competitor entered or bid up)
- Creative fatigue (CTR decay on aging creative)
- Tracking issue (conversion event broken, pixel misfire, GCLID drop)
- Audience saturation (frequency cap exceeded)
- Day-of-week effect (Mondays and Fridays often differ structurally from mid-week)
- Recent change (audience launch, budget shift, landing page update — reference the recent changes section if provided)
- Quality score or relevance score shift
- Seasonality or known industry pattern

4. Recommended Next Step
One specific, executable action per flagged metric. Frame as a proposal that requires human approval — not an automatic change. Format: "Recommend: [action]. Approve to proceed."

JUDGMENT RULES

- Do not flag a metric as anomalous if the underlying volume is too small to be meaningful. A 25% CPL spike on a channel that produced 4 leads yesterday is statistical noise. Flag the sample size before commenting.
- Day-of-week effects are real and common. Mondays often show lower volume; Fridays often show higher CPL. If yesterday is a Monday or Friday and the deviation aligns with that pattern, note it before raising alarm.
- Distinguish between metric-level anomalies (one number moved) and pattern-level anomalies (multiple correlated metrics moved together). Pattern anomalies are more likely to indicate real problems.
- If recent changes were provided in the inputs, weight those heavily as candidate causes before reaching for other explanations.
- If you don't have enough data to diagnose, say so explicitly. Do not invent root causes that sound plausible. "Insufficient data to distinguish auction pressure from creative fatigue — recommend pulling auction insights" is better than guessing.

OUTPUT FORMAT

Return as {OUTPUT_FORMAT}.

If "slack": format as a single Slack-ready message with severity emoji (🔴🟡🟢), bold metric callouts, and clear "Recommend:" action lines.
If "markdown": full structure with ## headings per section.

Begin.

How to Use It

This prompt is designed for Claude (Sonnet or Opus) and a daily workflow: run it each morning against the prior day's performance data and your rolling 7-day average. Claude handles multi-channel anomaly detection significantly better than ChatGPT in production testing — Claude's structured reasoning about correlated metric shifts and its willingness to say "insufficient data" rather than fabricating root causes makes a material difference when you're making spend decisions from its output. GPT-4 class models produce plausible output but are more likely to confidently suggest a root cause when the data is ambiguous.

The human-in-the-loop pattern matters here. Every recommendation the prompt returns is framed as a proposal requiring your approval — not an automatic change directive. That framing is intentional: you validate the root cause before acting on it. The severity rating (Red/Yellow/Green) lets you triage quickly; Red means multiple metrics moved against you simultaneously at meaningful scale, Yellow means one significant signal, Green means normal variance.

The prompt has three inputs: yesterday's data, the rolling average, and an optional "recent changes" section. That third input is the most leveraged — if you paste "launched a new LinkedIn audience on Tuesday," the model weights that heavily as a candidate root cause before reaching for other explanations. Leave it blank and the model diagnoses from the data patterns alone.

Example Output

Live Example

Example output coming soon — currently running this prompt against live data and will publish the redacted output once it's ready.

Common Failure Modes

Variations

Two variations of this prompt are worth knowing.

Variation 1: Daily Standup Version

The same anomaly logic scoped to a single day's data and trimmed for length — useful for daily paid media standups instead of weekly retrospective reviews. If you run daily check-ins on paid performance, this is the version you want. See the Weekly Paid Media Summary prompt for the broader weekly reporting version.

Coming soon

[PROMPT GOES HERE]

Variation 2: Cross-Channel Pattern Version

Detects when multiple channels show correlated anomalies simultaneously — the signal pattern that typically indicates a shared upstream cause (tracking break, landing page outage) rather than a channel-specific one. A single-channel CPL spike is often noise; a correlated multi-channel spike is almost never noise.

Coming soon

[PROMPT GOES HERE]

Get one new prompt every Monday.

Plus the system behind it. Free. Built for in-house demand gen managers at B2B SaaS companies.

Subscribe free →

Frequently Asked Questions

Does this prompt work with ChatGPT or only Claude?

Claude is the recommended choice for daily anomaly detection. In production testing, Claude produces more reliable diagnoses — it's more precise about statistical confidence ("the sample size is too small to flag this as an anomaly") and more structured about ranking candidate root causes. GPT-4 class models produce plausible output but are more likely to confidently suggest a root cause when the data doesn't clearly support it. For daily alerts where a wrong diagnosis can drive bad spend decisions, Claude's more conservative reasoning is the right trade-off.

How do I set the 20% threshold — can I change it?

Yes. The 20% deviation threshold is a starting point, not a fixed rule. High-volume channels (500-plus leads per month) can use a tighter threshold — 15% will surface real signals without too much noise. Low-volume channels (under 30 leads per month) need a higher threshold — 30% or 40% — to filter out day-to-day variance that doesn't indicate real movement. State your channel-specific thresholds in the inputs section when you adapt the prompt.

What's the difference between this prompt and the Weekly Paid Media Summary?

The weekly summary is backward-looking: it tells you how the week went. This prompt is forward-looking and diagnostic: it tells you when something anomalous happened and suggests why. Run the weekly summary on Mondays for exec reporting; run this prompt each morning to catch issues before they compound through the week.

How do I format the rolling average data?

A simple table works: same columns as yesterday's data (channel, spend, leads, CPL, conversions, CTR), but each row represents the 7-day average rather than yesterday's actuals. If you don't have a rolling average table ready, you can paste 7 days of daily data and ask the model to compute the average before running the anomaly detection — it handles that preprocessing reliably.