Sub topic 6
Keeping History Beyond Retention with BigQuery Export
This chapter assumes you know GA4 events, users, and the Admin area. You also need access to a Google Cloud project with BigQuery enabled.
GA4 event data retention controls how long user-level data remains available in GA4 features such as Explorations, segments, and audiences. It does not control how long exported data remains in BigQuery. BigQuery is a separate storage system, so you must define its own retention, access, and deletion rules.
What BigQuery export provides
BigQuery export copies GA4 event data into tables that you can query with SQL. The export includes event names, timestamps, user and device fields, traffic information, and event parameters. It can preserve history beyond the GA4 retention period.
GA4 provides two export options:
- The daily export creates one table for each day, such as
events_20261128. - The streaming export makes recent data available more quickly, but it can contain incomplete or updated data.
Export does not backfill data from before the connection was created. If you link a property today, the export begins with new data. Earlier events are not automatically copied into BigQuery.
The following diagram shows the separate data lifecycles:
Configure the export deliberately
In GA4, open Admin, then choose the property and select BigQuery Linking. Choose a Google Cloud project, select the data location, and enable daily export or streaming export.
The data location matters. BigQuery datasets are regional, and some organizations require data to stay in a particular region. Choose the location before creating the export because changing regions later may require a new dataset and migration plan.
After linking, configure BigQuery separately:
- Set table expiration or a dataset lifecycle policy.
- Control who can query raw event data.
- Estimate storage and query costs.
- Document whether the export is an archive, an analytics workspace, or both.
- Define how deletion requests are applied to exported data.
A BigQuery archive is not automatically a permanent archive. Tables can expire, projects can be disabled, and permissions can expose detailed user-level data. Treat the dataset as personal data if the exported fields can identify or single out people.
Query the exported history
GA4 exports data into a dataset commonly named like analytics_123456789. Daily tables use the events_YYYYMMDD pattern. This query counts events by name for a date range:
-- Replace the project, dataset, and dates before running.
SELECT
event_name,
COUNT(*) AS event_count
FROM
`my-project.analytics_123456789.events_*`
WHERE
_TABLE_SUFFIX BETWEEN '20260101' AND '20260131'
GROUP BY
event_name
ORDER BY
event_count DESC;The wildcard reads matching daily tables. _TABLE_SUFFIX limits the tables scanned, which reduces cost and improves performance. Avoid querying every table when you need only a small date range.
Plan an archive policy
Choose a retention period that matches a documented business and privacy purpose. For example, you might keep detailed events for 25 months, transform older data into monthly aggregates, and delete the raw tables afterward. Aggregation reduces detail but may prevent future analysis by user, device, or event parameter.
If a user requests deletion, follow the documented deletion process for both GA4 and BigQuery. Do not assume that deleting a user from GA4 removes every copy in derived tables, scheduled extracts, or downloaded files. Record which systems were checked and when.
Exercise
A property changed its GA4 event retention from 14 months to 2 months. Will a daily BigQuery export automatically lose the older exported tables?
Show answer
No. The GA4 setting does not delete BigQuery tables. BigQuery keeps them until its own expiration, deletion, or lifecycle policy removes them.