Google Analytics 4 (GA4) allows you to export raw event-level data to BigQuery for in-depth analysis. Below are the steps to set up the export, along with examples.
Step 1: Create a Google Cloud Project
- Go to the Google Cloud Console.
- Click Select a project > New Project.
- Enter a Project Name (e.g., “GA4-BigQuery-Project”).
- Choose an organization and location, then click Create.
- Once created, go to the project dashboard.
Example: If your company is “ABC Retail,” name the project “ABC-Retail-GA4.”
Step 2: Enable BigQuery API
- Navigate to APIs & Services > Library.
- Search for BigQuery API and click Enable.
Step 3: Set Up BigQuery Billing
- Go to Billing in Google Cloud Console.
- Link a billing account if not already linked.
- Ensure you’re on the free tier if just testing.
Step 4: Link GA4 to BigQuery
- Open Google Analytics Admin.
- In Admin, go to the Property Settings of your GA4 account.
- Under Product Links, click BigQuery Links.
- Click Link and follow these steps:
- Select the Google Cloud project created earlier.
- Choose a Region for your BigQuery dataset (e.g.,
USorEU). - Select Daily Export (recommended) or Streaming Export.
- Click Submit.
Example: If your GA4 property tracks e-commerce events, you may want to enable both daily and streaming exports to analyze real-time transactions.
Step 5: Verify Data in BigQuery
- Go to the BigQuery Console.
- Expand your project and look for the dataset (e.g.,
analytics_XXXXXXXX). - Click on a table (e.g.,
events_YYYYMMDD) and run a simple query:
SELECT event_name, COUNT(*) AS event_count
FROM `your_project.analytics_XXXXXXXX.events_YYYYMMDD`
GROUP BY event_name
ORDER BY event_count DESC;
- Click Run to see the results.
Step 6: Automate and Optimize Data Usage
- Set up scheduled queries to extract insights regularly.
- Use BigQuery ML for predictive analytics.
- Integrate with Looker Studio for visualization.
Things to Keep in Mind
- Data Retention: GA4 retains data for 14 months by default; adjust settings accordingly.
- Cost Considerations: BigQuery charges based on query processing and storage; monitor usage to avoid unexpected costs.
- Streaming vs. Daily Export: Streaming is useful for real-time analytics but incurs higher costs.
- Permissions: Ensure proper IAM roles are assigned for security and data access control.
- Data Transformation: GA4’s event-based model differs from Universal Analytics; plan queries accordingly.


Comments
2 responses
[…] Note: if you haven’t started tour bigquery journey, start here: How to set up BigQuery linkage in your Google Analytics 4 property […]
[…] Check out my step-by-step GA4 to BigQuery linkage guidance here: How to set up BigQuery linkage in your Google Analytics 4 property […]