GA4 BigQuery Cost
Before you dive in, understand how much a Google Analytics BigQuery data warehouse is going to cost you
The goal of this post is to summarize my experience of using BigQuery GA4 export data to help others decide whether they want to build their Google Analytics reporting based on BigQuery export data.
The cost of a BigQuery reporting system is a separate factor, as it can be either a benefit or a drawback depending on how the data warehouse is built and used.
As a rule of thumb, BigQuery storage is cheap and compute is expensive.
Storage
Google is giving the first 10 GiB of data in all storage categories for free, and I estimate it translates into 10-14M saved events. Given that on average sessions produce 3-5 events, this means the free tier will cover 2.5-3.5M sessions.
After the first 10 GiB, the most expensive type of storage is only $0.04 per GiB per month, so even the largest websites with multiple copies of their data rarely pay more than $100 per month in storage costs.
Compute
In a well-optimized data warehouse, the daily updates are done in increments, and they are easy on compute.
When I tested a full unnest with merge insert of 10,000 event records, the billed amount was 40Mb.
Therefore, even for a large website, the daily processing of the data should be under 1 TiB, which is $6.25. Since the first TiB of querying a month is free, most small and medium companies should be able to avoid monthly charges for regular updates.
In real life, the compute costs usually get run up when the data is being queried live by a BI solution, such as Looker Studio, Tableau, or Power BI. These services run a separate query for every chart/table or small change the user makes, like a date change.
It would be typical to see a dramatic increase in costs when a new analyst is trying to create a dashboard and using a live connection to a BigQuery table.
To avoid running up BigQuery compute costs, I recommend summarizing the data, extracting a copy of the summary table, and saving it on the BI solution server.
BigQuery Cost Monitoring
To monitor cost of your cloud services, I recommend that you turn on billing data export to BigQuery. This will create a schema called ‘billing_data’ where GCP will save detailed billing records for your services.
You can use this query to understand the breakdown of your BigQuery costs by type:
select
date(usage_start_time ) as billing_date,
service.description,
sku.description,
usage.unit,
count(*) as records,
sum(usage.amount_in_pricing_units) as amount_pricing_units,
sum(cost) as cost
from `billing_data.gcp_billing_export_resource_v1_YOUR_BILLING_NUMBER`
where
date(usage_start_time ) between ‘2024-04-01’ and ‘2024-06-01’
and service.description = ‘BigQuery’
group by billing_date, service.description, sku.description, usage.unit
order by billing_date, service.description, sku.description;
In addition to monitoring processes through the billing export, you can look up the details of the processes by going into the Job History (below the query results) and clicking on project history.
Click on the Actions dots to view job details and understand how the costs were incurred.
For example, the first record in the screenshot above is the daily Looker Studio extract, which syncs a BigQuery table to a Looker Table, thus saving the costs of sending a BigQuery request every time a user views a chart in Looker Studio.
Development Costs
The last, but far from the least, development is generally the largest portion of running custom reporting of Google Analytics data based in BigQuery. Here are an approximate breakdown of functions:
- Validating the data. Before you build, validate. Make sure you understand your data and the differences between BigQuery export and UI/Looker Studio.
- Creating staging tables, i.e. summary output tables that stage the data for a BI solution to report and visualize.
- Update automation. GA4 data is updated daily, and your summary tables will need to be updated, too.
- Monitoring. Quality Assurance never ends. The tasks include understanding how the GA4 data is changing, the new Google Cloud Platform services, and finding a more efficient way to run your data warehouse.
Other Considerations
Cost is not the only consideration for building your Google Analytics data warehouse. In this article, I went over detailed advantages and limitations of GA4 data in BigQuery to help you make the right decision.
by Tanya Zyabkina
Tanya Zyabkina has over 15 years of experience leading analytics functions for multiple Fortune 500 companies in the retail, telecom, and higher education. She built a GA4 Data Warehouse in BigQuery and reporting in Tableau for the The Ohio State University. Go Bucks!