Request a demo

GA4 in BigQuery · Working with the export

Query GA4 intraday tables together with daily tables

With streaming export on, GA4 writes today's events to events_intraday_YYYYMMDD and deletes it once the daily table is complete. events_* matches both, so filter _TABLE_SUFFIX for both name patterns, strip the intraday_ prefix to get the date, and prefer the daily table when both exist.

Runs on Google's public sample bigquery-public-data.ga4_obfuscated_sample_ecommerce · Scans 5.4 MiB, under $0.01 on-demand · Checked in November 2026

The query

-- Daily tables plus intraday tables, labeled by source
SELECT
  REPLACE(_TABLE_SUFFIX, 'intraday_', '')                          AS day,
  IF(STARTS_WITH(_TABLE_SUFFIX, 'intraday_'), 'intraday', 'daily') AS source_table,
  COUNT(*)                                                         AS events,
  COUNT(DISTINCT user_pseudo_id)                                   AS users
FROM `bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20210125' AND '20210131'
   OR _TABLE_SUFFIX BETWEEN 'intraday_20210125' AND 'intraday_20210131'
GROUP BY day, source_table
ORDER BY day, source_table;

How it works

The daily export lands once a day. The streaming export adds events_intraday_YYYYMMDD, which Google fills continuously as events arrive and deletes at the end of the day once events_YYYYMMDD is complete. If you want today's numbers, you need both.

The wildcard events_* matches both kinds of table, so _TABLE_SUFFIX is either 20210131 or intraday_20210131. That has two consequences. First, a plain _TABLE_SUFFIX BETWEEN '20210125' AND '20210131' silently excludes intraday tables, because the string intraday_... sorts after any digit. Second, a lower bound alone, such as _TABLE_SUFFIX >= '20210125', includes every intraday table that exists. The query above names both patterns explicitly and derives the date with REPLACE.

Intraday data is not final. Google's schema notes that is_active_user, user_ltv, traffic_source and publisher are not populated in intraday tables, and the daily table keeps receiving late events for up to three days. For anything older than today, read the daily tables. Projects in the BigQuery sandbox get no intraday import at all.

The sample has no intraday tables (all 92 tables are events_YYYYMMDD), so on the sample this query returns daily rows only. It still runs, which is the point: the same SQL works unchanged on an export with streaming on.

ColumnMeaning
dayEvent date taken from the table name, YYYYMMDD, for both table types.
source_tabledaily or intraday, so you can see when a day is still provisional.

Notes and cost

  • Cost: this reads user_pseudo_id for seven daily tables, 5.4 MiB. Intraday tables are billed like any other table when you query them.
  • A wildcard that matches no table, such as events_intraday_* on the sample or on an export without streaming, fails instead of returning zero rows. events_* with a _TABLE_SUFFIX filter avoids that.
  • _TABLE_SUFFIX >= FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 3 DAY)) is a good rolling filter for daily tables, but it also matches every intraday_ suffix, so check which table types you really get.
  • Streaming export has its own price, separate from query costs. Turn it on only if someone needs same-day data from BigQuery.

Variations

Prefer the daily table when both exist for a day

During the hand-over, a day can exist as both daily and intraday. This keeps intraday rows only for days with no daily table, so nothing is counted twice.

WITH all_events AS (
  SELECT
    REPLACE(_TABLE_SUFFIX, 'intraday_', '') AS day,
    STARTS_WITH(_TABLE_SUFFIX, 'intraday_') AS is_intraday,
    event_name,
    user_pseudo_id
  FROM `bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_*`
  WHERE _TABLE_SUFFIX BETWEEN '20210125' AND '20210131'
     OR _TABLE_SUFFIX BETWEEN 'intraday_20210125' AND 'intraday_20210131'
),
daily_days AS (
  SELECT DISTINCT day FROM all_events WHERE NOT is_intraday
)
SELECT
  day,
  COUNT(*)                       AS events,
  COUNT(DISTINCT user_pseudo_id) AS users
FROM all_events
WHERE NOT is_intraday
   OR day NOT IN (SELECT day FROM daily_days)
GROUP BY day
ORDER BY day;

Rolling window: the last three days, including today

Pruning still works with CURRENT_DATE(). On the sample, which ends in January 2021, it matches no table and scans 0 bytes.

SELECT
  REPLACE(_TABLE_SUFFIX, 'intraday_', '') AS day,
  COUNT(*)                                AS events
FROM `bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_*`
WHERE REPLACE(_TABLE_SUFFIX, 'intraday_', '')
      >= FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 2 DAY))
GROUP BY day
ORDER BY day;

FAQ

Why do events_* queries miss today's data?

Either streaming export is off, so there is no intraday table yet, or the _TABLE_SUFFIX filter only matches digits. Intraday suffixes start with intraday_, which a numeric BETWEEN range excludes.

Do intraday tables have traffic_source?

No. Google's schema says traffic_source, is_active_user, user_ltv and publisher are not populated in intraday tables. Use them from the daily table once it exists.

When is the intraday table deleted?

At the end of the day, after the daily events_YYYYMMDD table for that day is complete. The daily table can still receive late events for up to three days.

All GA4 export queries · BigQuery cost queries · The GA4 sample dataset

Cut BigQuery spend without guessing

Masthead attributes compute and storage cost to every project, user, pipeline and table, finds unused and dead-end tables, and shows where editions or on-demand pricing is cheaper. Mnemonic cut its BigQuery compute cost by 20% within 24 hours of onboarding.