To activate BigQuery streaming from GA4 (Google Analytics 4) to BigQuery and include the User ID, follow these steps:
1. Link GA4 to BigQuery
First, you'll need to link your GA4 property to a BigQuery project.
Go to Google Analytics and sign in with your account.
Navigate to the Admin section in the left-hand menu.
In the Property column, select the GA4 property that you want to link to BigQuery.
In the Product Links section, select BigQuery Linking.
Click Link and follow the prompts:
Select your BigQuery project (you can either create a new project or use an existing one).
Select your Location (Multi-region such as US or EU).
Choose a Data Streaming frequency: Daily
β
2. Enable Streaming for User Events
To include User ID in your BigQuery export, ensure the User ID is correctly configured in your GA4 property and that user-level data is part of the export.
In the GA4 property settings, make sure that User-ID is enabled:
Go to Admin > Data Streams.
Select your web data stream.
Under Enhanced Measurement, ensure that User-ID is configured and being collected correctly.
The User ID is included as a field in GA4 exports to BigQuery when it is properly set up within GA4.
3. Check the Exported Data in BigQuery
Once you've linked GA4 to BigQuery and enabled streaming, the data should begin flowing into your BigQuery dataset. Each event in BigQuery will have a series of fields, including user-level fields like user_pseudo_id and user_id (if set up correctly).
The user_id field represents the User ID if it is available for a particular session or event.
Query the events using SQL in BigQuery to verify that the User ID is being collected:
4. Ensure Permissions Are Correct
Ensure that both Google Analytics and BigQuery have the proper permissions:
The Google Analytics account used must have Editor or Administrator permissions to link with BigQuery.
In BigQuery, make sure the appropriate IAM roles (such as BigQuery Data Editor or BigQuery Admin) are assigned to the service account used for streaming.
By following these steps, you'll activate GA4's streaming service to BigQuery and ensure that User ID is included in the data export.