Marketing · n8n

Get a Slack Alert When Website Traffic Suddenly Spikes

Monitor your Google Analytics real-time users and post a Slack alert whenever traffic spikes far above normal, so you can capitalize on viral moments.

difficulty Intermediatesetup 40 minresult Your team is notified the moment traffic surges, letting you jump on trending content or catch issues early.
  1. 1

    Poll Real-Time Users

    Add a Schedule Trigger running every 10 minutes, then an HTTP Request to the GA4 Realtime API to fetch current active users.

  2. 2

    Compare Against a Baseline

    Add a Code node that keeps a rolling average in n8n static data and computes whether the current count exceeds, say, 2x the baseline.

  3. 3

    Filter Real Spikes

    Add an IF node that only continues when the spike threshold is crossed, avoiding noisy alerts.

  4. 4

    Alert in Slack

    Add a Slack node posting the current user count, the multiple over baseline, and the top active page so the team knows where to look.

  5. 5

    Activate and Tune

    Activate the workflow and adjust the threshold over a few days until alerts fire only on genuine surges.

Frequently asked questions

Can I include the traffic source?

Yes. Add source/medium as a dimension in the GA4 request so the alert tells you whether the spike is from social, search or referral.

How do I avoid repeated alerts for one spike?

Store a cooldown timestamp in static data and suppress new alerts for 30 minutes after one fires.

About this recipe. Recipes on FlowRecipesHub are written for business owners, not developers, and are tested before publishing — how recipes get made. Some ingredient links are affiliate links that cost you nothing — full disclosure.