Agent skill · data analytics · jeremylongshore

ga4-realtime-api

Pull current-session / active-user data from the GA4 Realtime endpoint — a separate API surface from runReport with different metrics, dimensions, and freshness guarantees (~30 min rolling window instead of T-48h). Trigger with "GA4 realtime", "active users right now", "GA4 current sessions", "who's on my site now".

Why this skill is useful

Provides specific commands and patterns for querying the GA4 Realtime API that the AI wouldn't reliably generate on its own.

What it needs

Requires curl, python3 installed locally. Requires google-analytics account access. About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

GA4 Realtime API Overview The Realtime API is GA4's "what's happening right now" endpoint. Different from runReport: runReport (Data API) runRealtimeReport (Realtime) --- --- --- Freshness ~24-48h lag, stable Last ~30 min, rolling Window Any date range Implicit — last 30 min Metrics ~50 supported ~10 supported (subset) Dimensions ~150 supported ~15 supported (subset) Quota Per-property daily Separate Realtime quota Use case Reports, dashboards, trend analysis Live dashboards, monitoring, "are we down?" Don't try to use runReport for now-data — its freshest data point is yesterday. Use runRealtimeReport. Prerequisites A GA4 Data API credential with access to the target property, configured through ga4-auth-setup. Python with google-analytics-data installed. A numeric property ID; realtime data is inherently a rolling, roughly 30-minute view and is not a replacement for historical reporting. Instructions Examples Minimum viable call No dateranges block — the implicit window is the last 30 min. Adding one will error. Realtime metrics (the full list) Metric What it counts --- --- activeUsers Unique users in the last 30 min screenPageViews Pageviews + screenviews in the last 30 min eventCount Total events in the last 30 min conversions Conversion events in the last 30 min keyEvents Key events (post-2024 rename of conversions) Custom-event aggregates (e.g. purchaserevenue) are NOT in the Realtime API. If you need realtime revenue, derive it from eventCount filtered to eventName=="purchase" plus your average AOV. Realtime dimensions (the full list) Dimension Use --- --- country, city Geo of currently-active users deviceCategory desktop / mobile / tablet split unifiedScreenName / unifiedScreenClass App screen / web title eventName Event-type breakdown streamId, streamName When property has multiple data streams (web + iOS + Android) platform web / ios / android appVersion, audienceName, audienceId When defined in the property That's the full list. ~15 dims total. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/ga4-realtime-api

View the source on GitHub

Browse the @skills marketplace