This is a post for beginners based on the assumption that you are already aware of the benefits of connecting your google analytics with BigQuery. One of the key ones is that you can use SQL like syntax to query the data and from there, sky is the limit.
The good news is it’s free to a large extent (well, if you aren’t processing a shitload of data). For small businesses that are data driven, in my honest opinion it makes sense. It also makes sense for freelance data analysts who want to get their hands dirty with BigQuery, get more adept and find more jobs.
For larger businesses, of course there will be costs for using BigQuery assuming they’ll process terabytes of data per day but the benefits far outweigh. By connecting GA4 with BigQuery, Google’s powerful data warehouse and analytics platform, businesses can harness the full potential of their data and gain deeper insights into their audience. Let’s see how we do this:
Setting up GA4
This one is obvious. To start getting in deep waters, you should first have your GA4 account ready (the deadline is coming soon, so get started on GA4 migration asap). Make sure you have the appropriate permissions and access to the GA4 property you want to integrate.
What are these permissions?
When you sign in to Analytics, use an email address that has OWNER access to the BigQuery project, and also has the Editor role for the Analytics property that includes the data stream you want to link.
Remember to set up BigQuery you need to set up a Google-APIs-Console project and enable BigQuery inside of the Google Cloud Platform. It sounds like crazy technical but its actually quite simple. Its like setting up a new account anywhere. The assumption is you are using a google account and so will have to just enabled your GCP. Once you are in GCP, do the following:
a. Create a new project in the Google Cloud Console if you don’t have one already.
b. Enable the BigQuery API and the Google Analytics API within your project.
c. Create a new dataset in BigQuery where the GA4 data will be stored.
Linking GA4 with BigQuery
Once your GA4 property and BigQuery project are set up, you can link them together. Here’s how:
a. In the GA4 Admin interface, find the link right under the “Property” column where you have all the rest of the links. Its called “BiggQuery Links”. Click and just follow the instructions on the screen.
b. When asked, choose the BigQuery project and dataset you created in the previous step.
c. Enable the data export and save the configuration.
There are 2 types of data export you can choose from Streaming and Daily. If you are new to all this just choose Daily for now. Streaming data makes your events available in a few minutes to query while Daily will export it into your BigQuery table once a day.
When you link Analytics and BigQuery, that process creates the following service account: [email protected]
Just make sure quickly that this account was added as a member of the project, and given the role of BigQuery User. It’ll normally do all of that itself but there is no harm checking. Head on to your Google Cloud Console and on the left hand navigation menu, click on IAM and Admin and then on IAM in the sub-menu. It’ll display the users that have access to it. If you dont see anything, maybe you have to select your project from the dropdown next to the Google cloud logo. Once you see the said email adddress added, you are good to go.
Make sure you select the right region when you create the Cloud project for BigQuery. Choose the region where you are based at. For EU website users, I’d recommend choosing EU.
How does data come through?
For the daily export option, the events of the entire day will be exported into a table called events_YYYYMMDD
And thats it, you are good to go.
Know your Limits
- Export limit: Currently the standard limit for daily export is set to 1 million events per day. The editors of the property will receive an email if this exceeds.
- BigQuery costs: The pricing is based on computing (when you query) and storage (when you store) but it has a free operations and a free usage tier. In simple words, for computing, you have 1TB free with the On-demand pricing and then going forward depends on the bytes you used. For all types of storage (active, long term), 10GB per month is free. Of course these may change anytime, so for latest on this and for any other use cases, refer to Google’s pricing page
By connecting GA4 with BigQuery, you unlock many powerful benefits like Access to raw and unsampled data for granular analysis and BigQuery’s advanced querying capabilities allow you to perform complex analysis, create custom reports, and build sophisticated dashboards. Moreover you can enrich data by combining GA4 data with other datasets within BigQuery, such as CRM or transactional data
This is a very very very simple rundown on how one can use BigQuery with GA4. However, if your use case is a bit complex, seek professional help, e.g. contact us 😉
Do you find this helpful. If yes, write in the comments and let us know what challenges are you facing. We’ll do our best to solve them for you.