πŸ“Š Ga4 anomaly detection with automated Slack & email alerts

⚑ 53 views Β· πŸ“Š Market Research & Insights

Description

Who’s it for

Teams that monitor traffic, signups, or conversions in Google Analytics 4 and want automatic Slack/email alerts when a channel suddenly spikes or drops.

What it does

This n8n template pulls daily GA4 metrics, detects outliers with a rolling mean and z-score, and sends alerts with a sparkline chart. It supports per-channel analysis (e.g., sessionDefaultChannelGroup) and consolidates multiple anomalies into a single email while posting each one to Slack.

How it works

Requirements

Where to find your GA4 Property ID

How to set up

  1. Open the Set (Define variables) node and fill: PROPERTY_ID, LOOKBACK_DAYS, ALERT_PCT, Z_THRESHOLD, CHANNEL_DIM, ALERT_ME.
  2. Connect your Google Analytics OAuth2, Slack, and Email credentials.
  3. In Email Send, map Subject β†’ {{$json.emailSubject}} and HTML body β†’ {{$json.emailHtml}}. Keep Execute once enabled.
  4. Run the workflow.

How to customize

Output example

Screenshot 20250826 at 18.32.15.png

πŸ”— Nodes Used

HTTP Request, Slack, Gmail, Schedule Trigger

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup