How to Count Active Users in GA4 BigQuery Data
Last updated August 29, 2026 · By the SaturnSQL team
COUNT(DISTINCT user_pseudo_id) gives total users in the export. The GA4 UI's headline Active users counts only engaged users, so filter on the session_engaged parameter to get close to it.
SELECT COUNT(DISTINCT user_pseudo_id) AS total_users
FROM `myproject.analytics_123456789.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20260801' AND '20260828';Engaged (active) users
SELECT COUNT(DISTINCT user_pseudo_id) AS active_users
FROM `myproject.analytics_123456789.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20260801' AND '20260828'
AND (SELECT value.string_value
FROM UNNEST(event_params)
WHERE key = 'session_engaged') = '1';Faster over long ranges
Exact distinct counts over months of daily tables shuffle every user_pseudo_id. APPROX_COUNT_DISTINCT(user_pseudo_id) is dramatically cheaper and lands within a percent or two, which is also roughly how the GA4 UI itself estimates users, so the approximate number is often the closer match to what the UI shows.
SELECT APPROX_COUNT_DISTINCT(user_pseudo_id) AS approx_users
FROM `myproject.analytics_123456789.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20260101' AND '20260828';Run this in SaturnSQL
SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.
Try it free