Implementation Guide for Big Query in Google Analytics 4
If you’ve been following up with GA 4 news, it’s easy to get tied down with endless comparisons to UA. While you could be overwhelmed and fence with exciting new and/or improved features, let me incentivize you to take the plunge: the BigQuery connection is free for all GA 4 properties ( formerly web+ apps).
While the subscribers of GA enterprise 360 might be familiar with the power and flexibility that BigQuery offers, all product users in GA 4 are now given access to hit level unsampled data ( remember you’ll only use API to export a part of data in UA free version), which is the biggest change ever happen to GA 4 for warehousing all of your raw analytics data.
Exciting to dive into more? In this implementation guide, I’ll walk you through the lesson I learnt on CXL at the setup and evaluation of Big Query. Hopefully, you can take it as a guide to set up your own Big Query!
Implementation of Big Query in GA 4
First, go into your property settings for linking and configure which Big Query projects you want to go ahead with.
Click “Choose a BigQuery project” to continue.
If you have the proper access to an existing BigQuery project, it is pretty straightforward, whereby you can simply select an existing project to link from the list. Conversely, if you need to create Big Query from scratch or don't see the project you need, you want to follow these detailed instructions with the steps below to set up the Google APIs Console project and enable BigQuery. Or possibly, get some assistance from your IT/developer to complete the process.
For those who already have a Big Query project, you can skip the next step.
Google APIs Console Project Setup
To set a new project in the BigQuery account, simply log in to Google APIs Console. Select “My Project” in the header and click “New Project” to create a project and type your project name.
(With your free account you are allowed up to 25 projects. ) Next, select an organisation and location you wish to attach to the project.
Note that your project name will automatically create a project ID, the selection of the organisation and ID created can’t be changed once it has been created.
Click ‘CREATE’ to continue and now you have a new BigQuery project setup. If you want to switch the project, you can simply go to the header and select from the dropdown menu. But as for now, you should see your selected project name there and the details of your project ( project name and ID) on the right of the screen.
Link Your BigQuery Project to GA 4
Assume you have done the setup of your project in the BigQuery account, you can prepare and select your project for export. Now, pick the region or location you want your data stored indirectly in GA 4. This will also help you to stay compliant with your data governance policy for the record in BigQuery.
In addition, you will have flexibility over specifying what streams you want to export, the option for the mobile advertising identifiers (mobile IDs) as well as the frequency setting (daily and streaming export options). The streaming configuration provides you with near real time access to continuous export for more timely analysis. Typically, those streaming data load every 10 to 15 mins, but Google has improved that down to within seconds.
In this case, you can choose Daily and Streaming export with all the conversion and attributes because of the export loading time and cheaper pricing for the additional costs.
Click “Submit” if everything is good to go.
Enable BigQuery by navigating to the APIs table
Now, head back to your Google APIs Console page and make sure your project is selected. Open the Navigation menu. Click APIs & Services> Click on the “+ Enable APIs and Services”.
And there you should see the notification popping out with the welcome statement like below.
Now go ahead in the search bar query and type “ Big Query API”. ( The one with the top is what you need to select > click on it and the “Manage” button.
Then head back to APIs and Services Navigation Menu ( on your left panel) and click on “Credentials” to add a firebase service account, which would be used to export GA 4 data to Big Query. Here you would need to click on the “Create credentials” button > select service account.
Here you should see a screen like below:
Enter firebase-measurement@system.gserviceaccount.com as the service account name > have the role assigned > then hit “Done”.
You should see your new service account listed below:
Wait for data to be configured
Wait a day or so to check if your raw GA data is sitting under the project by navigating back to your BigQuery account and make sure you select the exact project. You should be able to see the project ID as “analytics_<property_id>”, which you can find in the property settings for your GA 4 property.
At this point, you’ve pretty much nailed it!
Wrap up
Getting started is not always easy if you have never used or heard of Big Query and SQL before. Charles Farina, the GA 4 Veteran, has created a bunch of resources where you might find it useful. I’ll recommend checking out these resources to help you understand more since if you are like starting BigQuery from scratch, these are definitely a good guide.
- BigQuery Export Schema
- Setup Guide (Google)
- Setup Guide (Charles)
- Query Templates: Bounteous, Pawel/Simo, Ken Williams , Google