GA4 Anomaly Detection: How to Catch Traffic Drops Before They Cost You

GA4 Anomaly Detection: How to Catch Traffic Drops Before They Cost You

14 min read
Abhinav Pandey
Abhinav Pandey
Founder, Anomaly AI (ex-CTO & Head of Engineering)

Your organic traffic dropped 40% last Tuesday. You found out on Friday. By then, the broken redirect had been live for three days, costing you hundreds of conversions. Sound familiar?

GA4 has built-in anomaly detection, but it's passive — it waits for you to check. And it only flags what it considers statistically significant, often missing the signals that matter most to your business. This guide covers how GA4's native anomaly detection works, where it falls short, and how to build a monitoring system that actually catches problems before they become expensive.

What Is Anomaly Detection in Analytics?

Anomaly detection identifies data points that deviate significantly from expected patterns. In the context of Google Analytics, that means flagging when:

  • Traffic drops unexpectedly (broken pages, lost rankings, tracking failures)
  • Traffic spikes unusually (bot traffic, viral content, referral spam)
  • Conversion rates change (broken forms, pricing page issues, checkout bugs)
  • User behavior shifts (engagement drops, bounce rate spikes on specific pages)

The challenge: not every fluctuation is an anomaly. Traffic varies naturally by day of week, season, and campaign schedules. Good anomaly detection separates real problems from normal noise.


GA4's Built-In Anomaly Detection

GA4 includes anomaly detection out of the box through two features: Automated Insights and Custom Insights.

Automated Insights

GA4 uses machine learning to automatically detect unusual changes in your data. You'll find these on the Home screen and in the Insights card.

What GA4 automatically detects:

  • Significant increases or decreases in metrics (users, sessions, conversions)
  • Changes in user segments (e.g., mobile traffic suddenly drops)
  • Emerging trends (e.g., a new traffic source growing quickly)

How It Works

GA4 builds a statistical model of your historical data (typically the previous 90 days). When a new data point falls outside the expected range, it triggers an insight. The model accounts for:

  • Day-of-week patterns: Monday traffic is expected to differ from Sunday
  • Trend direction: If traffic has been gradually increasing, a small dip isn't flagged
  • Seasonality: Holiday periods are handled differently

How to Access

  1. Go to Home in GA4
  2. Scroll to the Insights card
  3. Click View all insights to see the full list
  4. Click any insight to see the details and affected data

Custom Insights (Alerts)

Custom insights let you define your own anomaly rules with email notifications — the closest thing to "alerts" in GA4.

Setting Up Custom Insights

  1. Go to Home → scroll to Insights → click View all insights
  2. Click Create (top right)
  3. Choose a suggested condition or Start from scratch
  4. Configure:
    • Evaluation frequency: Daily, weekly, or monthly
    • Segment: All users or a specific segment
    • Metric: The metric to monitor (e.g., active users, conversions)
    • Condition: % increase, % decrease, or specific threshold
    • Value: The trigger point (e.g., "decreases by more than 30%")
  5. Toggle Email notifications on and add recipients
  6. Click Create

Recommended Custom Insights to Set Up

Alert Name Metric Condition Why It Matters
Traffic crash Active users Decreases >30% (daily) Catch tracking breaks, server outages, ranking drops
Conversion drop Key events Decreases >25% (daily) Broken forms, checkout issues, CTA problems
Bot traffic spike Active users Increases >100% (daily) Referral spam, bot attacks, inflated metrics
Mobile engagement crash Engagement rate (mobile segment) Decreases >20% (daily) Responsive design breaks, slow mobile load times
Revenue anomaly Total revenue Decreases >20% (daily) Pricing errors, payment gateway issues, cart abandonment spike

Limitations of GA4's Native Anomaly Detection

  • Passive by default: Automated insights sit on the Home screen — you have to check them. No push notifications unless you set up custom insights.
  • Limited granularity: Can't monitor specific pages, campaigns, or user segments with automated insights. Custom insights help but are limited to simple threshold rules.
  • No root cause analysis: GA4 tells you what changed but not why. You still have to investigate manually.
  • Delayed detection: Daily evaluation means you might not learn about a problem until the next day.
  • No cross-source context: GA4 anomaly detection doesn't consider data from other sources (Search Console, ad platforms, server logs) that could explain the anomaly.

Advanced: Anomaly Detection with BigQuery

For teams that need more sophisticated detection, GA4's BigQuery export opens up statistical methods that go far beyond simple threshold alerts.

Prerequisites

  • GA4 → BigQuery export enabled (see our GA4 data export guide for setup)
  • Basic SQL knowledge
  • BigQuery free tier is sufficient for most sites

Method A: Z-Score Detection

Z-scores measure how many standard deviations a data point is from the mean. A score above 2 or below -2 typically indicates an anomaly.

WITH daily_sessions AS (
  SELECT
    PARSE_DATE('%Y%m%d', event_date) AS date,
    COUNT(DISTINCT
      CONCAT(user_pseudo_id, '-',
        (SELECT value.int_value FROM UNNEST(event_params)
         WHERE key = 'ga_session_id'))
    ) AS sessions
  FROM `your-project.analytics_PROPERTY_ID.events_*`
  WHERE _TABLE_SUFFIX BETWEEN
    FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 90 DAY))
    AND FORMAT_DATE('%Y%m%d', CURRENT_DATE())
  GROUP BY date
),
stats AS (
  SELECT
    AVG(sessions) AS mean_sessions,
    STDDEV(sessions) AS stddev_sessions
  FROM daily_sessions
)
SELECT
  d.date,
  d.sessions,
  ROUND((d.sessions - s.mean_sessions) / NULLIF(s.stddev_sessions, 0), 2) AS z_score,
  CASE
    WHEN (d.sessions - s.mean_sessions) / NULLIF(s.stddev_sessions, 0) > 2 THEN 'SPIKE'
    WHEN (d.sessions - s.mean_sessions) / NULLIF(s.stddev_sessions, 0) < -2 THEN 'DROP'
    ELSE 'NORMAL'
  END AS status
FROM daily_sessions d
CROSS JOIN stats s
ORDER BY d.date DESC
LIMIT 30

Method B: Moving Average Comparison

Compare each day's traffic to a rolling 7-day average. This handles weekly seasonality better than a flat mean.

WITH daily_sessions AS (
  SELECT
    PARSE_DATE('%Y%m%d', event_date) AS date,
    COUNT(DISTINCT
      CONCAT(user_pseudo_id, '-',
        (SELECT value.int_value FROM UNNEST(event_params)
         WHERE key = 'ga_session_id'))
    ) AS sessions
  FROM `your-project.analytics_PROPERTY_ID.events_*`
  WHERE _TABLE_SUFFIX BETWEEN
    FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 90 DAY))
    AND FORMAT_DATE('%Y%m%d', CURRENT_DATE())
  GROUP BY date
)
SELECT
  date,
  sessions,
  ROUND(AVG(sessions) OVER (
    ORDER BY date
    ROWS BETWEEN 7 PRECEDING AND 1 PRECEDING
  ), 0) AS rolling_7d_avg,
  ROUND(
    (sessions - AVG(sessions) OVER (
      ORDER BY date ROWS BETWEEN 7 PRECEDING AND 1 PRECEDING
    )) / NULLIF(AVG(sessions) OVER (
      ORDER BY date ROWS BETWEEN 7 PRECEDING AND 1 PRECEDING
    ), 0) * 100, 1
  ) AS pct_deviation
FROM daily_sessions
ORDER BY date DESC
LIMIT 30

Flag days where pct_deviation exceeds ±25% as anomalies worth investigating.

Method C: Page-Level Anomaly Detection

Site-wide metrics can mask page-specific problems. This query detects pages where traffic dropped significantly compared to their own baseline.

WITH page_daily AS (
  SELECT
    (SELECT value.string_value FROM UNNEST(event_params)
      WHERE key = 'page_location') AS page,
    PARSE_DATE('%Y%m%d', event_date) AS date,
    COUNT(*) AS pageviews
  FROM `your-project.analytics_PROPERTY_ID.events_*`
  WHERE event_name = 'page_view'
    AND _TABLE_SUFFIX BETWEEN
      FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 14 DAY))
      AND FORMAT_DATE('%Y%m%d', CURRENT_DATE())
  GROUP BY page, date
),
page_stats AS (
  SELECT
    page,
    AVG(pageviews) AS avg_daily_views,
    STDDEV(pageviews) AS stddev_views
  FROM page_daily
  WHERE date < DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)
  GROUP BY page
  HAVING AVG(pageviews) > 10
)
SELECT
  d.page,
  d.date,
  d.pageviews,
  ROUND(s.avg_daily_views, 0) AS expected,
  ROUND((d.pageviews - s.avg_daily_views) /
    NULLIF(s.stddev_views, 0), 2) AS z_score
FROM page_daily d
JOIN page_stats s ON d.page = s.page
WHERE d.date = DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)
  AND (d.pageviews - s.avg_daily_views) /
    NULLIF(s.stddev_views, 0) < -2
ORDER BY s.avg_daily_views DESC

Automating BigQuery Alerts

To turn these queries into automated alerts:

  1. BigQuery Scheduled Queries: Run the anomaly query daily, writing results to a table
  2. Cloud Functions + Pub/Sub: Trigger a function when new anomalies are detected, send a Slack message or email
  3. Looker Studio: Build a dashboard that shows the anomaly table, check it daily

This works well but requires ongoing maintenance. For a simpler approach, consider the AI-powered option below.


AI-Powered Anomaly Detection for GA4

The gap between GA4's basic alerts and BigQuery's statistical methods is where most teams get stuck. You need something smarter than "notify me when traffic drops 30%" but you don't want to maintain SQL pipelines and Cloud Functions.

How Anomaly AI Handles GA4 Anomaly Detection

The name isn't a coincidence. Anomaly AI was built to find the unexpected in your data — and GA4 is one of the most connected data sources.

Here's what it does differently:

  • Automatic baseline learning: Understands your data's patterns — weekly cycles, seasonal trends, campaign-driven spikes — without manual configuration
  • Multi-metric correlation: Doesn't just flag that traffic dropped; correlates it with other changes (e.g., traffic dropped and a specific landing page lost ranking and conversion rate on that page changed)
  • Natural language investigation: When an anomaly is detected, ask follow-up questions: "Why did organic traffic drop on Feb 15?" and get a data-driven answer
  • Cross-source context: Combine GA4 anomalies with data from BigQuery, Google Sheets, or databases to understand the full picture
  • SQL transparency: Every detection shows the underlying query so you can verify and trust the results

Example Workflow

  1. Connect GA4 to Anomaly AI
  2. Ask: "Show me any anomalies in my GA4 traffic over the past 2 weeks"
  3. The AI runs statistical analysis across sessions, conversions, engagement, and source breakdowns
  4. Returns flagged anomalies with context: "Sessions from organic search dropped 35% on Feb 18. The decline is concentrated on 3 landing pages: /product, /pricing, /features. Other sources are stable."
  5. Follow up: "What happened to those pages specifically?"
  6. Get deeper analysis: engagement metrics, device breakdown, geographic changes

Common GA4 Anomalies and What Causes Them

Sudden Traffic Drop (All Sources)

Likely causes:

  • GA4 tracking code removed or broken (check browser console for gtag errors)
  • Tag Manager container paused or misconfigured
  • Server/hosting outage
  • New cookie consent banner blocking GA4 scripts

First check: Look at Realtime reports — if they show 0 users, it's a tracking issue, not a traffic issue.

Organic Traffic Drop Only

Likely causes:

  • Google algorithm update (check Google Search Status Dashboard)
  • Lost rankings on key pages (check Google Search Console)
  • Broken redirects or pages returning 404s
  • robots.txt accidentally blocking important pages
  • Domain migration issues

Conversion Rate Drop (Traffic Stable)

Likely causes:

  • Broken form or checkout flow (test the conversion path manually)
  • Page layout change that moved the CTA below the fold
  • New traffic source sending unqualified visitors
  • A/B test variant performing poorly
  • Payment gateway issue (for e-commerce)

Traffic Spike (Unplanned)

Likely causes:

  • Bot traffic or referral spam (check source/medium for suspicious referrers)
  • Content went viral on social media
  • Competitor's site went down, redirecting their traffic
  • Press mention or high-authority backlink

First check: Look at engagement rate and session duration. Bot traffic typically has near-0% engagement and sub-1-second sessions.

Engagement Rate Drop (Traffic Stable)

Likely causes:

  • Page speed regression (run Lighthouse or PageSpeed Insights)
  • Content quality issue on high-traffic pages
  • Intrusive interstitials or pop-ups driving users away
  • Mobile layout broken (check device-specific engagement rates)

The 5-Minute Anomaly Investigation Framework

When you spot an anomaly, follow this sequence to find the root cause fast:

  1. Scope it: Is it all traffic or one source? All pages or specific ones? All devices or just mobile? Narrow down the affected segment.
  2. Time it: When exactly did it start? Correlate with deployments, campaigns, or external events (algorithm updates, competitor changes).
  3. Compare it: Is the same-period-last-year showing the same pattern? Is it day-of-week noise or a real shift?
  4. Cross-reference: Check Google Search Console (ranking changes), server logs (errors), Tag Manager (recent changes), and deployment history.
  5. Test it: Visit the affected pages yourself. Check tracking in browser dev tools. Test the conversion flow end-to-end.

Frequently Asked Questions

Does GA4 have anomaly detection built in?

Yes. GA4 includes automated insights powered by machine learning (on the Home screen) and custom insights that let you set threshold-based alerts with email notifications. However, they're limited to simple conditions and don't provide root cause analysis.

How sensitive should my anomaly alerts be?

Start conservative: 25-30% change thresholds for traffic, 20-25% for conversions. If you get too many false positives, increase the threshold. If you're missing real issues, lower it. The right sensitivity depends on your traffic volume — high-traffic sites can use tighter thresholds because their data is less noisy.

Can I detect anomalies in real time with GA4?

GA4's Realtime report shows the last 30 minutes but doesn't have anomaly detection. For near-real-time anomaly detection, you need BigQuery streaming export combined with a monitoring tool, or an AI analytics platform with live data connections.

What's the difference between GA4 anomaly detection and Google Analytics Intelligence?

Google Analytics Intelligence was the Universal Analytics feature that answered natural language questions and provided automated insights. In GA4, this evolved into the Insights feature (automated + custom). The core concept is the same, but GA4's version uses newer ML models and integrates with GA4's event-based data model.

How do I detect anomalies across multiple GA4 properties?

GA4's native insights work per-property only. For cross-property monitoring, export all properties to BigQuery (they can share a dataset) and run anomaly detection SQL across them. Or use an AI analytics platform that can connect multiple GA4 properties.


Set Up Your GA4 Anomaly Monitoring

Here's the minimum viable monitoring setup that catches 90% of issues:

  1. Right now (5 minutes): Set up 3 custom insights in GA4 — traffic crash, conversion drop, and bot spike (use the table above)
  2. This week: Build a GA4 dashboard with week-over-week comparison charts for your top 5 metrics
  3. If you need more: Connect GA4 to Anomaly AI for automatic anomaly detection with natural language investigation — the AI finds problems you wouldn't think to look for

Related guides:

Ready to stop finding problems after they've already cost you? Get started with Anomaly AIconnect your GA4 property and let AI monitor your analytics 24/7.

Ready to Try AI Data Analysis?

Experience AI-driven data analysis with your own spreadsheets and datasets. Generate insights and dashboards in minutes with our AI data analyst.

Abhinav Pandey

Abhinav Pandey

Founder, Anomaly AI (ex-CTO & Head of Engineering)

Abhinav Pandey is the founder of Anomaly AI, an AI data analysis platform built for large, messy datasets. Before Anomaly, he led engineering teams as CTO and Head of Engineering.