top of page

How to Load Google Analytics 4 Data into Snowflake in 10 steps

Google Analytics 4 (GA4) is an effective web analytical tool for monitoring the performance of your websites and applications. Compared to older versions, GA4 added enhanced capabilities by giving application users more comprehensive information about users’ activities to help make better business decisions. However, to maximize the usability of the GA4-collected data, exporting it to the Snowflake data warehouse is desirable. Due to extract, load, and transform (ELT) architecture, Snowflake ensures fast and scalable storage while allowing users to perform almost any analysis and integrating all data into BI tools. With the ability to transfer this data into Snowflake, organizations are in a position to hold all their data in one place, run complex queries on their data, and generate powerful reports, which greatly increases an organization’s analytical capacity.


Steps to Load GA4 Data into Snowflake

 

1. Create a GCP Project

If you don't have a Google Cloud Platform (GCP) project yet, you need to create one to link with your GA4 property.


GCP Project page

2. Activate Cloud Resource Manager API

Ensure that the “Cloud Resource Manager API” is activated for your GCP project. This step is crucial for managing cloud resources and establishing necessary links.


Cloud Resource Manager API page

3. Configure the BigQuery Link

For each GA4 property you wish to load into Snowflake, configure the BigQuery link. This will enable the data to be exported from GA4 to BigQuery.


Note: If you choose the Daily export type, GA4 may take up to 24 hours to load data into the GCP project.

 

GA4 Bigquery Links page

4. Install Snowflake Connector for Google Analytics Raw Data

Go to the Snowflake marketplace and install the “Snowflake Connector for Google Analytics Raw Data.” This connector facilitates the integration between GA4 data in BigQuery and Snowflake.


Snowflake connector for google analytics

5. Open the Snowflake App and Complete Prerequisites

Open the Snowflake app and ensure that all prerequisites are met. If you already have a GA4 account and have created the GA4 link to your GCP project, you can skip to step 3.


Snowflake connector setup

6. Configure OAuth Consent Screen and Client ID


Configure the OAuth consent screen and generate a client ID for your GCP project using the URL provided by the app for your account. Save the Client email and Private key for use in the subsequent steps.

 

GCP Credentials page

7. Create or Select a Warehouse, Database, Schema, and Role


Create a new warehouse, database, schema, and role in Snowflake, or select existing ones, and proceed to the next step.


Snowflake connector configuration

8. Connect Using OAuth2


In the next step, select the OAuth2 option, paste the client ID and Client Secret generated in the GCP project, and press connect to select your Google account.


Snowflake connector Authentication

9. Validate Google Analytics Data


Snowflake will check for Google Analytics data in the GCP platform. If no data is found, ensure the BigQuery link is properly created.


Snowflake connector validation

10. Select Properties and Start Sync


After validation, select the GA4 properties you wish to sync to Snowflake and start the synchronization process.


Snowflake connector properties

11. Query Output Table:

 

After the sync is finished you can query the GA4 data in the previous created database.

 

Snowflake Query

Conclusion

 

Follow the steps above to successfully ingest Google Analytics 4 data to Snowflake. It also provides connectivity to Snowflake analytics to allow for greater insights as well as enhanced decision-making. From complex analytics to the extended use of other BI tools, getting your GA4 data in Snowflake is a valuable addition to your data management and contributes to business development. Well done for completing the tutorial on pulling GA4 data into your Snowflake database!


About the author: Felipe Novais is a Data Engineer at BRF Consulting, a Snowflake partner specialized on Data Engineering and Business Intelligence.

19 views0 comments

Comments


bottom of page