How to Export Google Analytics Data to BigQuery
Sending your Google Analytics 4 data to BigQuery is one of the most powerful moves you can make to understand your marketing performance. It unlocks your raw, event-level data, freeing you from the limitations and sampling of the standard GA4 interface. This tutorial will walk you through exactly why you should do it and how to set it up, step-by-step.
Why Connect Google Analytics to BigQuery?
While the Google Analytics 4 interface is great for day-to-day snapshots, it has some significant limitations when you need to dig deeper. Connecting to BigQuery, Google's cloud data warehouse, solves these problems and gives you a much richer analytical playground.
Here’s what you gain by making the connection:
- Escape from Data Sampling: In the GA4 interface, complex reports or date ranges with a lot of data will often trigger data sampling. This means your report is based on a smaller subset of your data, making it an educated guess rather than a precise count. In BigQuery, you get all of your raw, unsampled data, giving you 100% accuracy.
- Own Your Data: The data in your GA4 property is subject to Google's data retention policies (up to 14 months for event-level data on the free version). When you export it to BigQuery, you own it forever. You are building a permanent historical record of your business's performance that belongs to you.
- Combine Data from Other Sources: This is a big one. You can merge your GA4 event data with data from your CRM (like Salesforce or HubSpot), your ad platforms (Facebook Ads, Google Ads), and your payment or e-commerce platforms (Stripe, Shopify). This allows you to answer critical questions like, "Which marketing campaigns lead to high-value customers?" or "What's the true lifetime value of users acquired through organic search vs. paid ads?"
- Perform Advanced Analysis: With your raw data in BigQuery, you can run complex SQL queries to build custom attribution models, analyze user paths in granular detail, and create advanced customer segmentation that simply isn't possible in the standard UI.
Before You Begin: What You'll Need
Setting up the GA4 to BigQuery export is straightforward, but you need a few things in place first. Make sure you have these prerequisites squared away to ensure a smooth process.
Requirements:
- A Google Analytics 4 Property: The BigQuery export is a feature specific to GA4. If you're still on the outdated Universal Analytics, you'll need to migrate to GA4.
- A Google Cloud Platform (GCP) Project: BigQuery is part of the Google Cloud ecosystem. If you don't have a GCP project, you'll be prompted to create one during the setup. It's free to create an account and project.
- Appropriate Permissions: To successfully link the two, you need the right access levels:
- Billing Enabled on Your GCP Project: This is a crucial step that trips many people up. Even though the export from GA4 is free, you need to have a credit card and active billing account attached to your GCP project to cover any potential BigQuery storage and processing costs beyond the free tier.
What About Costs?
It's important to understand the pricing model, but don't let it scare you off. For most small to medium-sized businesses, the cost is often zero or very minimal.
- The GA4 Export: The daily export of your data from GA4 to BigQuery is completely free. There are no charges from the Google Analytics side.
- BigQuery Costs: You only pay for BigQuery's storage and querying. The good news is that BigQuery has a generous free tier that resets every month:
For most websites, 10 GB of storage will hold months, if not years, of data. And 1 TB of querying is a massive amount of processing—you'd have to be running very complex queries around the clock to exceed this. For context, scanning a simple events table for a month on a medium-sized site might only use a few gigabytes of processing.
Step-by-Step Guide: Linking GA4 to BigQuery
Ready to get started? Let's walk through the exact steps to connect your GA4 property to a BigQuery project.
Step 1: Go to Your GA4 Admin Settings Log in to your Google Analytics account and navigate to the GA4 property you want to connect. Click on the gear icon labeled "Admin" in the bottom-left corner.
Step 2: Find the BigQuery Links Option In the Admin panel, look for the middle column labeled "Property." Scroll down until you see the "Product Links" section and click on "BigQuery Links".
Step 3: Create the Link On the BigQuery Linking screen, you’ll see any existing links or an empty list. Click the blue "Link" button in the top right to start a new connection.
Step 4: Choose Your BigQuery Project Next, you'll be prompted to choose a BigQuery project. Click on "Choose a BigQuery project". A list of all the GCP projects your account has access to will appear. Select the project you want to export your GA4 data into. If you don't have one, this is where you can be guided to create a new one.
Step 5: Configure Your Data Settings This is the most important part of the configuration. You’ll need to make a few decisions here.
- Data location: Choose the geographical region where your data will be stored (e.g.,
us-central1). It’s a good practice to choose the location closest to you or a location where you store other relevant data. Note that you cannot change this once the link is created. - Configure data streams and events: Here you can select which data streams (e.g., your website, your iOS app) to include in the export. Most users will just select "All" to get everything. You can also explicitly exclude certain events if you don’t need them in your BQ dataset, though it's generally best to include everything.
- Export Frequency: This is a key decision. You have two options:
Step 6: Review and Submit Once you’ve configured everything, review your selections on the final screen to make sure they're correct. If everything looks good, click "Submit".
That’s it! You've successfully linked GA4 to BigQuery. The connection is now active, but you won't see data immediately. Google states that a full data export will begin within 24 hours.
What Your GA4 Data Looks Like in BigQuery
After your first export completes (give it about a day), you can head over to your Google Cloud project to see the data. In the BigQuery console, you'll find a new dataset named analytics_PROPERTY-ID (where PROPERTY-ID is your numeric GA4 Property ID).
Inside this dataset, you’ll see tables named events_YYYYMMDD. Each table contains one full day of your raw event data. If you enabled the streaming export, you will also see an additional table called events_intraday_YYYYMMDD which houses the near real-time data for the current day before it's moved into its permanent daily table.
The schema of these tables can look a little intimidating at first because GA4 data is nested. This means that instead of having a huge number of columns, information like event parameters and user properties is stored within a single column as a "record."
Example: Your First SQL Query
Learning SQL can feel like a big hurdle, but you can start with simple queries to get a feel for your data. Here’s a basic query to count the total number of page view events yesterday. You'll need to replace your_project_id, your_property_id, and yyyymmdd with your own info.
SELECT
COUNT(*) as total_pageviews
FROM
`your_project_id.analytics_your_property_id.events_yyyymmdd`
WHERE
event_name = 'page_view'This is just the tip of the iceberg. The real power comes from un-nesting records to analyze specific event parameters and joining this data with your other business data sources. Acknowledging this complexity is the first step toward true data mastery.
Final Thoughts
Connecting Google Analytics to BigQuery elevates your analytics game by giving you control over your raw, unsampled data. This opens up a new world of advanced analysis, data ownership, and the ability to create a unified view of your customer by joining GA4 data with other marketing and sales platforms.
Navigating Google Cloud, setting up data pipelines, and learning SQL is a significant commitment. We know that most marketers and business owners just want clear answers, not a second career as a data engineer. That's why we created a tool that provides the power of an analyst without the complexity. With Graphed, we handle the integration directly with Google Analytics and your other data sources. You can skip the tedious setup and the SQL learning curve and simply ask questions about your data in plain English to build real-time, interactive dashboards in seconds.
Related Articles
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.
How to Create a Photo Album in Meta Business Suite
How to create a photo album in Meta Business Suite — step-by-step guide to organizing Facebook and Instagram photos into albums for your business page.