Home Blog Service Analytics

How to Connect and Export Data from GA4 to BigQuery?

Author Image
Max is a data science expert @Viden, helping brands leverage their data to deliver valuable insights and growth opportunities across digital. With extensive expertise in data visualization, he specializes in providing creative and efficient reporting solutions.
How to Connect and Export Data from GA4 to BigQuery?

As Google Analytics transitions to GA4, an important feature of many analytics pipelines has also been changing. This transition makes it necessary for users to sync their analytics from GA4 into BigQuery with different methods than before. To make this process simpler and easier to understand, we have put together this guide which explains all the options currently available for exporting GA4 data into BigQuery. From this guide, you can learn key details about how each method works and what it’s best suited for so that you can make the best decisions for your company’s specific usage needs.

Why Enable the BigQuery Linking to GA4?

The new version of Google Analytics — GA4 — introduces several new features and changes, one of which is the ability to link GA4 to BigQuery. BigQuery is Google’s cloud-based data warehousing service. Enabling the BigQuery linking feature will allow you to export your GA4 data to BigQuery for further analysis.

There are several reasons why you should enable the BigQuery linking feature in GA4. First, it will allow you to take advantage of BigQuery’s powerful data processing capabilities. With BigQuery, you can run complex queries on large datasets that would be difficult or impossible to do with other data processing tools. Second, linking GA4 to BigQuery will give you access to your raw data. This is important because it will allow you to perform custom analyses that are impossible with the out-of-the-box reports in GA4. Finally, linking GA4 to BigQuery will help you save money on storage costs. This is because BigQuery charges based on the amount of data processed, not stored.

Further Reading: Why Migrate to Google Analytics 4 in 2023? UA vs. GA4 Metrics Comparison

Methods to Connect Google Analytics 4 to BigQuery

There’re three different methods that allow you to connect Google Analytics 4 to BigQuery. They are:

  1. Google APIThe first method for connecting GA4 to BigQuery is through the Google Analytics Data Export API. This option requires some technical know-how and coding skills, as you will need to set up an application to access the API. Once set up, you can use the API to pull raw analytics data into BigQuery, where it can be analyzed further using advanced analytics tools like SQL or Python.
  2. Third-Party Tools A second option for connecting GA4 to BigQuery is using third-party tools such as Stitch Data or FiveTran. These solutions offer an easier setup process than using the Google API, as they take care of all the intricate details such as authentication, scheduling, filtering, and more. They also offer additional features like automatic schema detection, custom transformations, and more that make it easy to get actionable insights from your data.
  3. Manual Export The final option for connecting GA4 data to BigQuery is manual export. This involves manually exporting your analytics data from GA4 into CSV files which can then be imported into BigQuery using either the web UI or one of its command line utilities. This method may not be suitable for large datasets due to its manual nature, but it might be helpful if you want quick access to specific metrics without having to go through complex setup processes.

Now let’s look into them in detail.

 

By proceeding further you agree to our Privacy Policy

Connecting GA4 with BigQuery through Google API

The first step in connecting GA4 with BigQuery is setting up your account. You’ll need to set up a Google Cloud Platform (GCP) account and a Google Analytics 4 property for the connection to work.

Once those are set up, you can start the process of setting up the connection between them by following these steps:

    1. Go to the Google Cloud Platform Console and select either an existing project or create a new one

Select a project in Google Cloud Platform Console

Source: console.cloud.google.com

    1. Select “APIs & Services” from the left menu bar, then click on “Library”

Select “APIs & Services” in Google Cloud Platform Console

Source: console.cloud.google.com

  1. Find and select “BigQuery API” and enable itBefore you move further, you’ll also need to add the firebase-measurement@system.gserviceaccount.com account to your BigQuery project. To do that:
      • Click the menu in the top-left corner of the screen and go to IAM & Admin -> IAM, and click Add on top

    IAM & Admin in GCP

    Source: console.cloud.google.com

    • Paste the address above and give it Editor access; then click Save

    Giving editor access in GCP

    Source: console.cloud.google.com

  2. Then you need to sign in to your Google Analytics account and use an email address with the Owner access to the BigQuery project and an Editor role for the Analytics property that includes the data stream you want to link
  3. In the GA4 Admin page, make sure you have the desired account and property scheduled.
  4. Then click BigQuery Links in the Property column under PRODUCT LINKS.
  5. BigQuery Links section in GA4
  6. Click LinkChoose a BigQuery project and select a project from the list; click Confirm
  7. Then select a location for the data; if your project already has a dataset for the Analytics property, you can’t configure this option
  8. Click Next and choose Configure data streams and events to select 1) the data streams to include with the export and 2) specific events to exclude from the export.
  9. Choose a Daily or Streaming export of data (or both of them):

Daily and Streaming Export of Data in GA4

Note about the table updating:

  • Updates to the tables created as part of BigQuery Export are governed by the time zone of the Analytics property from which data is being exported.
  • Streaming-export tables (events_intraday_YYYYMMDD) are updated continuously throughout the day (e.g., from 12:00:00 am until 11:59:59 pm in the property’s time zone); once a new day starts in the property’s time zone, events are written to a new intraday table.
  • Daily export tables (events_YYYYMMDD) are created after Analytics collects all of the events for the day. Analytics will update daily tables for up to 72 hours beyond the date of the table with events that are time-stamped with the date of the table, e.g., event bundles that come in late from Measurement Protocol or the Firebase SDKs. For example, if the table date is 20220101, then Analytics will update the table through 20220104 with events that are time-stamped 20220101.

You can check more information here.

We recommend not using the data in the reporting until the full update occurs. Tables are usually updated within 12 – 24 hours.

Table updates in GA4

Finally, review your settings and confirm that you want a configured link; the data will soon start flowing from GA4 to BigQuery at the chosen frequency.

Exporting Data from GA4 to BigQuery Manually

It’s not a common situation, but sometimes you’ll need to export only the specific data to BigQuery and do it individually. In this case, you won’t need to connect GA4 and BigQuery and then import it into BigQuery. To export a report from Google Analytics 4, load it and click the Share button in the top-right corner. Select Download file and pick CSV as a format. Another option is to choose PDF, which won’t be good for importing into BigQuery.

Share report in Google Analytics 4

Enable the BigQuery Linking for GA4

Connecting and exporting data from GA4 into BigQuery is an efficient way for digital marketing specialists or digital analysts who rely heavily on their website analytics for insights about their customer’s behavior and preferences. By following these simple steps outlined above, anyone can connect GA4 with BigQuery quickly so they can start leveraging their website analytics more effectively! But if you still need help connecting GA4 and BigQuery or feel confused about migrating to GA4, our team is here to help you. Contact us now and get our experts on a call.

Get in Touch Now

Get in touch

Got a question? We'd love to hear from you. Send us a message and we'll respond as soon as possible.



    By clicking submit, you agree to our Privacy Policy

    Latest Insights

    Get the tips from our experts to optimize and scale your campaigns

    20 June 2024

    The Importance of Using Analytics in Advertising

    Nowadays, businesses face the challenge of constantly refining their advertising campaigns to optimize performance. Given the complexity of the modern consumer’s journey, with its numerous touchpoints and channels, leveraging analytics in advertising plays a crucial role for businesses in achieving their desired outcomes. In 2022, Gartner reported that 53% of marketing decisions were driven by […]

    Learn more

    13 June 2024

    Prevent Data Loss: Set Up BigQuery Error Notifications

    BigQuery has gained significant popularity and is increasingly utilized in numerous projects. Google’s cloud-based data warehouse solution is known for its scalability, speed, and ability to handle large datasets efficiently. As more organizations integrate BigQuery into their data processing and analytics workflows, robust monitoring and alerting mechanisms are essential. Implementing alerts for jobs that encounter […]

    Learn more

    30 May 2024

    How To Create A Meaningful Ecommerce Analytics Dashboard: A Step-by-step Guide

    Are you drowning in a huge amount of e-commerce data? There’s no other way to escape it if you want your e-commerce store to succeed. However, you can make analyzing your data much more enjoyable and effective. The key is to present e-commerce data analytics visually. Data visualization plays a big role in data-driven decision-making. […]

    Learn more

    28 March 2024

    Navigating the Data Deluge: Prioritizing Key Metrics in the Age of Google Analytics 4

    With the advent of Google Analytics 4 (GA4), the key business challenge becomes not collecting data but discerning what truly matters in the sea of data. 64% of marketing executives believe data-driven marketing is crucial to success in a hyper-competitive global economy. By prioritizing key metrics and avoiding the trap of tracking everything, businesses can […]

    Learn more

    3 January 2024

    How to Create a Viable First-Party Data Strategy in 2024?

    Discover the 9 key steps to build a first-party data strategy that maximizes customer data and enhances your marketing efforts.

    Learn more

    27 December 2023

    How To Create a Seamless Customer Experience to Win More Returning Clients

    Want customers hitting a repeat button? Learn the secrets to building a seamless customer experience that keeps them coming back for more.

    Learn more

    30 November 2023

    Maximize Your Data Retention in Google Analytics 4 (GA4) 

    Learn how to manage data storage and protect privacy with GA4 data retention settings.

    Learn more

    24 November 2023

    How to Read and Interpret Google Analytics 4 Reports to Drive Business Success

    Get to know how to read Google Analytics 4 reports to uncover customer insights, optimize marketing strategies, and drive business growth.

    Learn more