Skip to main content

Scenario

Traffic just spiked — maybe a tweet went viral, a Product Hunt launch is live, or a competitor’s outage is sending visitors your way. You pull GA4’s real-time report showing active users by page and traffic source, identify the spike, and send it to Mave for diagnosis and response recommendations. The result is a real-time playbook: what’s happening, why, and what to do next.

Architecture

Code

Example Output

Error Handling

GA4 real-time reports show data from the last 30 minutes with ~1-minute latency. Numbers are approximate and may differ from standard reports.
Set BASELINE_ACTIVE_USERS to your typical real-time user count. Check GA4 → Reports → Real-time during normal hours to establish this.
Real-time reports count against the same 10 concurrent / 50,000 daily quota. Don’t poll more frequently than every 60 seconds.

What’s Next

GA4 Integration

Back to GA4 integration overview

Landing Page Performance → Content Refresh

Rewrite underperforming landing page copy

Acquisition Channel × Persona Mapping

Map channel-demographic pairs to personas

Mave Agent

Full reference for POST /api/v1/mave/chat