Daily GA4 anomaly alerts in Slack with Search Console

Every weekday at 8am, scan yesterday's GA4 traffic against a 28-day baseline and post a ranked Slack alert when channels or pages move sharply. Silent otherwise.

Agentic Task
Google AnalyticsGoogle Search ConsoleSlackMarketingOperationsNotifications & AlertsResearch & MonitoringAI Reports
PromptCreate

Build me an agent workflow that watches my Google Analytics 4 property every weekday morning and only pings Slack when something is meaningfully off. It should be silent by default and stay out of my channel on normal days.

Trigger: cron, every weekday (Monday through Friday) at 8am in my local timezone. Expose the time and timezone as user-editable inputs.

Step 1. Pull yesterday's traffic from Google Analytics 4 using Batch Run Reports for my configured GA4 property. I want two breakdowns in one batch: (a) sessions, conversions, and total revenue by default channel grouping, and (b) the same metrics by landing page plus hostname for the top 50 landing pages by sessions. Date range is yesterday in the property's timezone.

Step 2. In the same Batch Run Reports call (or a second one if needed), pull a 28-day prior baseline for the exact same dimensions and metrics, ending the day before yesterday. Compute the trailing daily average per channel and per landing page so seasonality and growth are baked in.

Step 3. For each channel and each top landing page, compare yesterday's number to its 28-day average. Flag it as an anomaly if it moves outside the configured thresholds AND clears a minimum-volume floor so dead pages do not spam alerts. Pick reasonable defaults but expose them as user-editable inputs: percent_down_threshold default 30, percent_up_threshold default 50, min_sessions_floor default 50 sessions per day, baseline_window_days default 28.

Step 4. If any flagged anomaly is on the Organic Search channel (or on a landing page where the bulk of yesterday's traffic came from Organic Search), call Google Search Console Search Analytics Query for the same yesterday vs prior 28-day window, scoped to the affected URLs. Pull clicks, impressions, CTR, and average position. Use the deltas to decide the likely diagnosis: a real ranking drop (position got worse, impressions down), a tracking break (Search Console clicks steady but GA4 sessions dropped), a CTR collapse (impressions steady, clicks down), or a genuine demand shift.

Step 5. If there is at least one real anomaly, post one Slack message via Send a Message to the configured Slack channel. Format it as a short ranked list, biggest move first, with one line per anomaly: which channel or page, the metric, yesterday vs the 28-day average with percent change and absolute numbers, the agent's best diagnosis, and a one-line suggested next step (for example check pixel firing, review recent publish, confirm campaign budget). Keep the whole message tight enough to read on a phone.

Step 6. If nothing clears the thresholds, do not post anything. No 'all green' message, no heartbeat, no daily noise. Silent is the success state.

User-editable inputs to expose at the top of the workflow: ga4_property_id, search_console_site_url, slack_channel, percent_down_threshold, percent_up_threshold, min_sessions_floor, baseline_window_days, run_time, timezone, optional slack_mention for who to ping on a critical drop.

Important: GA4 data lags a few hours and Search Console lags 2 to 3 days, so when comparing GA4 'yesterday' against Search Console, the agent should account for Search Console's freshness window when forming the diagnosis (note it in the alert if Search Console data is not yet complete for the relevant day).

Additional information

What does this prompt do?
  • Every weekday morning, compares yesterday's sessions, conversions, and revenue against a 28-day baseline by default channel grouping and by top landing pages.
  • Flags channels or pages whose yesterday number is meaningfully outside the average (configurable thresholds, plus a minimum traffic floor so low-volume pages do not spam alerts).
  • When Organic Search is the suspect, checks Google Search Console clicks, impressions, CTR, and average position for the affected URLs so the alert points at a likely cause.
  • Posts one short ranked Slack message with magnitude, direction, the most likely diagnosis, and a suggested next step. If nothing is off, it stays silent.
What do I need to use this?
  • A Google Analytics 4 property and an account with access to it.
  • A Slack workspace and the channel where you want anomaly alerts to land.
  • A Google Search Console verified property for the same site, used to diagnose dips in organic search traffic.
How can I customize it?
  • Change the run time, the timezone, or which days of the week it checks.
  • Tune the anomaly thresholds (for example 30 percent down or 50 percent up) and the minimum sessions floor that keeps small pages quiet.
  • Swap the Slack channel, add a mention for whoever is on duty, or extend the metrics to include users, engagement rate, or specific conversion events.

Frequently asked questions

Will it alert me on big spikes too, or only on drops?
Both. Big spikes can mean a viral moment or a tracking bug, so the watcher flags meaningful moves in either direction and the alert tells you which way it went.
What happens on a normal day with no anomalies?
Nothing gets posted. The point is a signal-only channel, so quiet days stay quiet and you only see Slack messages when something is actually worth looking at.
How does it decide what is 'normal'?
It compares yesterday to the trailing 28 days for the same channel or landing page, so weekly seasonality and steady growth trends are already baked into the baseline.
Do I have to connect Google Search Console?
Only if you want a likely cause attached to organic search dips. Without it you still get the alert, just without the search performance context for ranking or indexing issues.
Can I run it more often than once a day?
Yes, you can change the schedule to twice a day or even hourly, but once a day is usually enough to catch real issues without creating alert fatigue.

Catch GA4 issues the day they happen.

Connect Google Analytics, Search Console, and Slack once. Geni watches your traffic every weekday morning and only pings you when something real has moved.