How to export GA4 data to BigQuery?
Activating the BigQuery export
Exporting raw GA4 data to BigQuery is one of the major advantages of the free version of GA4. To activate it, go to your GA4 property administration, Product Links section, then BigQuery. You will need a Google Cloud Platform project with billing enabled (the export itself is free, but BigQuery storage and queries are billed).
Select the data location (choose the EU for GDPR compliance), then opt for daily export, streaming (continuous), or both. The daily export creates one table per day with all consolidated data. The streaming export feeds an intraday table updated in near real-time. For most analytical use cases, the daily export is sufficient and limits costs.
Data structure and queries
Data arrives in BigQuery as event-based tables. Each row corresponds to an event, with nested fields (RECORD) for parameters, user properties, and traffic information. This structure requires using UNNEST in SQL to access individual parameters.
The most common queries involve calculating metrics not available in the GA4 interface, creating complex segments, cross-referencing with imported CRM data, or feeding machine learning models.
Costs and optimization
BigQuery storage costs approximately $0.02 per GB per month. Queries are billed by the volume of data scanned. For a site generating 100,000 events per day, expect a few gigabytes per month. Use date partitioning, materialized views, and scheduled queries to control costs. Then connect BigQuery to Looker Studio to visualize your data in custom dashboards.