My Step-By-Step Blueprint For Querying GA4 data in BigQuery without understanding a single line of SQL. Query GA4 BigQuery Data via ChatGPT (73 Pages) Download the FREE ebook
Table of Contents
- Prerequisites for backfilling GA4 data in BigQuery
- 10,000 foot view for backfilling GA4 data in BigQuery
- Create a new dataset for storing historical GA4 data
- Decide your schema for the data transfer.
- Create a new data transfer to backfill GA4 data in BigQuery
- Schedule backfill
Backfilling GA4 data in BigQuery means importing historical GA4 data into your BigQuery project.
If you are like me, you may have been collecting data in your GA4 property for years.
But if you have only recently connected GA4 with BigQuery, you may not have all the historical data in your BigQuery project.
This is because, by default, the GA4 data is imported to BigQuery only from the date you first connected your GA4 property to your BigQuery project.
If you want historical GA4 data in your BigQuery project, then you would need to backfill GA4 data in BigQuery.
Note: If you want to backfill GA3 (Universal Analytics) data in BigQuery (in order to take its backup before it is deleted by Google), then check out this article: How to backfill Google Analytics data in BigQuery.
Prerequisites for backfilling GA4 data in BigQuery
Before you can backfill GA4 data in your BigQuery project:
- You would need a Google Cloud Platform account with billing enabled.
- You would need a BigQuery project with billing enabled where you are going to store the GA4 data.
- You would need to connect your GA4 property with your BigQuery project.
- You would need a dataset in your existing project for storing historical GA4 data.
- You would need a paid connector (like βSupermetrics for BigQueryβ) to backfill your GA4 data. You canβt backfill GA4 data for free.
10,000 foot view for backfilling GA4 data in BigQuery
#1 Create a new dataset.
Create a new dataset in your BigQuery project for storing historical GA4 data.
I prefer creating a new dataset for storing historical GA4 data instead of using the pre-built dataset (βanalytics_<property_id>β). This makes data management easier.
#2 Decide your schema.
Decide the schema you will use for your data transfer.
You can either create and use your own schema (also called the custom schema) or use the default schema provided by your paid connector.
If you want to see your data tables with only the fields you want, then you need to first create your own schema and then use the custom schema while creating the data transfer.
We will use the standard schema to simplify the process of backfilling GA4 data in BigQuery.
#3 Create a new data transfer.
With the help of the paid connector, create a new data transfer.
You can create a new data transfer either via the Google Cloud Console or via the Supermetrics hub.
Regardless of the method you used to create a data transfer, you would still need to use a paid connector.
We will create a new data transfer via the Google Cloud Console.
Note: If you want to create a new data transfer via the supermetrics hub, then check out this article: Sending Custom GA4 data to BigQuery.
#4 Schedule backfill
The initial data transfer will backfill only two days of historical GA4 data. To backfill more historical GA4 data, you will need to schedule a backfill.
You can schedule a backfill once your initial data transfer has been completed successfully.
Note: The GA4 data retention policies could restrict the amount of data you are allowed to backfill.
The amount of data you are allowed to backfill will depend upon the connector being used.
For example, the βSupermetrics for BigQueryβ connector allows you to backfill up to six monthsβ worth of data at one time.
If you want to backfill more data, then you would need to do it in separate batches of six months sized.
Create a new dataset for storing historical GA4 data
Follow the steps below:
Step-1: Navigate to your BigQuery account: https://console.cloud.google.com/bigquery
Step-2: Make sure that you are in the correct project where you want to store the historical GA4 data:
Step-3: Click on the three dots menu next to the project ID where you want to store the historical GA4 data:
Step-4: Click on βCreate Datasetβ:
Step-5: Name your data set (e.g. βhistorical_ga4_dataβ) and then click on the βCreate Datasetβ button:
You should now see the new dataset created under your project ID:
Note: The βhistorical_ga4_dataβ dataset does not contain any data table or any data. For that, you would first need to create and run a data transfer.
Decide your schema for the data transfer.
We will use the standard schema supplied by supermetrics to simplify the process of backfilling GA4 data in BigQuery.
Feel free to create a custom schema if you want to see your data tables with only the fields you want.
However, make sure that you select your custom schema when you configure your data transfer.
Create a new data transfer to backfill GA4 data in BigQuery
Step-1: Navigate to BigQuery data transfers: https://console.cloud.google.com/bigquery/transfers
Step-2: Click on the β+ CREATE TRANSFERβ button:
Step-3: Click on the βSourceβ drop-down menu to select a data source:
Step-4: Click on βExplore Data Sourcesβ:
You should now see a screen like the one below:
Step-5: Type βGoogle Analytics 4β in the search box, press the enter key and then click on βGoogle Analytics 4 by Supermetricsβ:
Step-6: Click on the βENROLLβ button:
You should now see the βGoogle Analytics 4 by Supermetricsβ listed under the βSourceβ menu:
Step-7: Select βGoogle Analytics 4 by Supermetricsβ as the source and then type βBackfill GA4 data to BigQueryβ under the βTransfer config nameβ field:
Step-8: Select the βhistorical_ga4_dataβ dataset from the drop-down menu:
Step-9: Click on the βCONNECT SOURCEβ button:
Step-10: Click on βACCEPT AGREEMENTβ button:
Step-11: Click on βSign in with Googleβ button:
Step-12: Once you have signed in then click on the βContinueβ button:
Step-13: Select your schema from the drop-down menu. We will use βSTANDARDβ:
Step-14: Select your GA4 property from the drop-down menu and then click on the βSubmitβ button:
You should now see the βSource Connectedβ message:
Step-15: Click on the βSAVEβ button to save and start your data transfer:
You should now see a screen like the one below, which shows the current status of your data transfer: βThe Transfer run is pendingβ:
Step-16: Refresh your browser window to check the current status of your data transfer.
You should now see a screen like the one below, which shows the current status of your data transfer: βThe Transfer run is in progressβ:
Step-17: After a couple of minutes, again refresh your browser window to check the current status of your data transfer.
You should now see a screen like the one below, which shows the current status of your data transfer: βThe transfer run has completed successfully.β:
Congratulations. You have now successfully backfilled two days of GA4 data in your BigQuery project.
Now letβs check this new historical GA4 data.
Step-18: Click on the βSQL Workspaceβ from the left navigation menu:
Step-19: Navigate to the data set you created earlier for storing the historical GA4 data (in our case, it would be βhistorical_ga4_dataβ). You should now be able to see a new set of data tables listed under your dataset:
Step-20: Click on a data table and then click on the βPREVIEWβ tab to see the imported historical GA4 data:
Schedule backfill
The initial data transfer backfilled only two days of historical GA4 data. To backfill more historical GA4 data, you will need to schedule a backfill.
You can schedule a backfill once your initial data transfer has been completed successfully.
Follow the steps below to backfill more GA4 data in BigQuery:
Step-1: Navigate to BigQuery data transfers: https://console.cloud.google.com/bigquery/transfers
Step-2: Click on the link βBackfill GA4 data to BigQueryβ:
Step-3: Click on the βSCHEDULE BACKFILLβ button:
You should now see a screen like the one below:
Step-4: Click on the option βRun for a date rangeβ, select your start date and time and then your end date and time from the date selector:
Note: The βSupermetrics for BigQueryβ connector allows you to backfill up to six monthsβ worth of data at one time. If you want to backfill more data, then you would need to do it in separate batches of six months sized.
Step-5: Click on the βOKβ button to start the backfill:
You should now see the backfilled scheduled message at the bottom of your screen:
Step-6: Refresh your browser window to see the current status of various data transfers.
You should now see a screen like the one below:
When you run a data transfer, you may see one or all of the following four messages under the βSummaryβ columns:
- The transfer run has completed successfully.
- The transfer run is in progress.
- The transfer run is pending (manually requested)
- The transfer run has failed.
If a transfer run has failed, then click on the βRETRYβ button:
Step-7: Wait for the data transfer to complete. This could take some time, depending on how much data you requested to be backfilled.
Step-8: Click on the βSQL workspaceβ link from the left-hand side navigation:
Step-9: Navigate to the data set you created earlier for storing the historical GA4 data (in our case, it would be βhistorical_ga4_dataβ). You should now be able to see all of the historical GA4 data in your dataset.
Thatβs how you can backfill GA4 data in BigQuery.
Other articles related to GA4 (Google Analytics 4)
#1 Google Analytics 4 Intro
- What is GA4 (Google Analytics 4) β The Apps + Web Property?
- Key Benefits of Using Google Analytics 4 (GA4)
- GA4 Migration Guide β Learn to upgrade to GA4 from GA3 via checklist
- Google Analytics 4 (GA4) vs Universal Analytics β What is the Difference?
- GA4 vs GA4 360 β Pricing, Limits, Billing and More
- Google Analytics 4 Training & Tutorial with FREE GA4 ebook
- Google Analytics 4 (GA4) Channels, Source and Medium explained.
- Blueprint for Google Analytics 4 Implementation
- Understanding Google Analytics 4 cookies β _ga cookie
#2 Google Analytics 4 Property
- Google Analytics Account Hierarchy (Structure Explained)
- Understanding Google Analytics Measurement ID (GA4)
- Google Signals GA4 β See Demographics (Gender, Age) in Google Analytics 4
- Using the GA4 (Google Analytics 4) Test Property
- Google Analytics 4 Sub Properties Tutorial
- Roll up Property in Google Analytics 4 (GA4) β Tutorial
#3 Google Analytics 4 Integrations
- How to connect GA4 (Google Analytics 4) with Google Data Studio
- How to link GA4 (Google Analytics 4) with Google Ads
- How to link Google Search Console to Google Analytics 4 (GA4)
- How to Install Google Analytics 4 on Shopify
- GA4 Firebase Integration β Correctly Add App Data Streams to GA4 Property
- How to link Google Analytics 4 with Adsense
#4 Google Analytics 4 Events
- GA4 (Google Analytics 4) Event Tracking Setup Tutorial
- Understanding Event Parameters in Google Analytics 4 (GA4)
- Recommended Events in Google Analytics 4 (GA4)
- Enhanced Measurement Events in Google Analytics 4 (GA4)
- Automatically Collected Events in Google Analytics 4 (GA4)
- How to Set Up GA4 Custom Events via Google Tag Manager
- Events Report in Google Analytics 4 (GA4)
- How to Rename Events in Google Analytics 4 (GA4)
- How to Use Google Analytics 4 Event Builder
- GA4 Form Interactions Tracking β Enhanced Measurement
#5 Google Analytics 4 Conversions
- Google Analytics 4 Conversion Tracking Guide β GA4 Goals
- How to Import Conversions from GA4 Property to Your Google Ads account
- GA4 Conversion Rate β How to find it and use it
#6 Google Analytics 4 Dimensions
- GA4 (Google Analytics 4) Dimensions Tutorial
- GA4 (Google Analytics 4) Custom Dimensions Tutorial
- GA4 User Properties (User Scoped Custom Dimensions) β Tutorial
- Event Scoped Custom Dimensions in GA4 β Tutorial
- How to remove (other) in GA4 reports and avoid Cardinality.
- How to remove not set in GA4 (Google Analytics 4)
#7 Google Analytics 4 Metrics
- GA4 (Google Analytics 4) Metrics Tutorial with Free Google Analytics 4 Ebook
- GA4 (Google Analytics 4) Custom Metrics Tutorial
- What are Predictive Metrics in Google Analytics 4 (GA4)
#8 Google Analytics 4 Ecommerce
- GA4 (Google Analytics 4) Ecommerce Tracking via GTM β Tutorial
- Understanding Google Analytics 4 Monetization Reports
- Understanding Google Analytics 4 Ecommerce Purchases Report
- Understanding Google Analytics 4 In-app purchases Report
- Understanding Google Analytics 4 Publisher Ads Report
- Understanding Google Analytics 4 Promotions Report
- Understanding Google Analytics 4 User Purchase Journey Report
- Understanding Google Analytics 4 Order Coupon Report
#9 Google Analytics 4 Specialized Tracking
- GA4 (Google Analytics 4) Enhanced Measurement Tracking Tutorial
- Cross Domain Tracking in GA4 (Google Analytics 4) Setup Guide
- GA4 Site Search β Tracking Site Search in Google Analytics 4
- GA4 (Google Analytics 4) Scroll Tracking Tutorial
- Self-referral Google Analytics 4 β Referral exclusion GA4
- GA4 (Google Analytics 4) Data Import Tutorial
- Google Analytics 4 Content Grouping β Create Content Groups in GA4
- How to Track Single Page Apps in Google Analytics 4 (GA4)
- utm_source, utm_medium, utm_campaign Parameters β GA4 (Google Analytics 4)
- GA4 Form Tracking via Google Tag Manager
- How to Track Phone Calls in Google Analytics 4 β Call Tracking Tutorial.
- How to use Microsoft Clarity with GA4 (Google Analytics 4)
#10 Google Analytics 4 filters
- GA4 filters β Understanding Data Filters in Google Analytics 4
- How to Create and Test Filters in Google Analytics 4 (GA4)?
- Exclude Internal Traffic in GA4 (Google Analytics 4) via IP Filter
#11 Google Analytics 4 Explorations
- Free Form Report in GA4 (Google Analytics 4) β Exploration Report
- How to Use the User Lifetime Report in Google Analytics 4 (GA4)
- How to Use Path Exploration Report in GA4 (Google Analytics 4) β Path Analysis
- How to Use Segment Overlap Report in Google Analytics 4 (GA4)
- How to Use the Funnel Exploration Report in GA4 (Google Analytics 4) β Funnel Analysis
- Cohort Exploration Report in Google Analytics 4 (GA4)
- How to Create Landing Pages Report in GA4 (Google Analytics 4)
- How to Create Google Ads report in GA4 (Google Analytics 4)
- How to Segment GA4 Data by Data Stream
- Organic Search Traffic Analysis in GA4 β Complete Guide
- Google Analytics 4 (GA4) Outbound Links Tracking
- How to Track Email Campaigns and Traffic in GA4
- How to view full page URLs in GA4?
- How to view full referral URL in GA4 (Google Analytics 4)
#12 Google Analytics 4 Advanced
- Understanding Google Analytics 4 Sessions
- GA4 (Google Analytics 4) Measurement Protocol Tutorial
- How to Build Comparisons (Advanced Segments) in Google Analytics 4 (GA4)
- Understanding Automated Insights in Google Analytics 4 (GA4)
- Understanding Channel Groupings in Google Analytics 4 (GA4)
- Understanding Data Sampling in Google Analytics 4 (GA4)
- Google Analytics 4 Regex (Regular Expressions) Tutorial
- Google analytics 4 GDPR compliance checklist
- How to Exclude URL Query Parameters in Google Analytics 4
- What is unassigned traffic in GA4 and how to fix it.
- Google Analytics 4 not working? Here is how to fix it.
#13 Google Analytics 4 Reports
- How to Create Custom Insights in Google Analytics 4 (GA4)
- How to Use Debug View Report in Google Analytics 4 (GA4)
- How to see Organic Search Keywords in GA4 (Google Analytics 4)
#14 Google Analytics 4 Attribution
- Guide to Attribution Models in GA4 (Google Analytics 4)
- How to Change Attribution Models in GA4 (Google Analytics 4)?
- GA4 (Google Analytics 4) Conversion Paths Report in Attribution
- GA4 (Google Analytics 4) Model Comparison Report in Attribution
- Advertising Snapshot in GA4 (Google Analytics 4) Attribution
- GA4 Attribution Modelling Tutorial
#15 Google Analytics 4 Audiences
- GA4 Audiences β Creating Custom Audience in Google Analytics 4
- How to Create a Remarketing Audience in Google Analytics 4 (GA4)
- Understanding Audience Triggers in Google Analytics 4 (GA4)
- Google Analytics 4 (GA4) Predictive Audiences β Tutorial