To use event data from Google Analytics 4 in SegmentStream, you need to first set up a Google Analytics 4 BigQuery Link. Please refer our guide Set up GA4 BigQuery Link ensuring that the following requirements are met:
- Ensure that the data location of the BigQuery dataset used in SegmentStream matches the one configured in GA4.
- Enable the Streaming export type. Additionally, you have the option to enable Daily export.
- Ensure that no events are excluded in your BigQuery Link settings.
Once the GA4 BigQuery Export is set up, data should start flowing to your BigQuery project within 24 hours. After that happens, you will be able to connect your Google Analytics 4 to SegmentStream.
Connecting Google Analytics 4 to SegmentStream
- Inside the admin panel navigate to Settings → Events Tracking.
- Click + ADD and select the Google Analytics 4 option.
- In the drawer that opens authorise your Google account.
- Select the account and property where your data is collected.
- Click Save.
- All event data exported to your BigQuery in the past 60 days will be processed by SegmentStream, and reports will become available. This process might take a couple of hours.
Please follow our guide on passing additional parameters to help SegmentStream integrate better with your business - .
Referral exclusion logic
To ensure SegmentStream provides accurate insights, it's crucial that it accurately identifies where each session's traffic is coming from. Properly setting up referral exclusions is key, especially when users move between different domains or subdomains, like during redirects.
Typical scenarios for using referral exclusions are to stop counting traffic from payment gateways, login systems, or other internal processes as external referrals.
SegmentStream uses the settings from your Google Analytics 4 (GA4) property to filter out these unwanted referrals. So, if your GA4 is correctly set up, SegmentStream will automatically apply those same settings. This process helps identify and exclude unwanted referral traffic through the following methods:
- Identifying when visitors navigate within different parts of your site or its subdomains, preventing these movements from being counted as external visits. If it’s necessary for your business to track subdomain referrals, visit the following link - FAQ.
- Redirects between websites specified in your GA4 stream's cross-domain measurement function are treated similarly to redirects within the same domain and are excluded from referral tracking. Learn more about setting up cross-domain measurement in Google's documentation here.
- You can further control unwanted referrals by configuring the unwanted referrals list in your GA4 stream settings. Refer to Google's documentation for step-by-step guidance on configuring unwanted referrals here.
BigQuery access issues
If the Google Analytics 4 BigQuery link is connected to a different project than the one specified in the SegmentStream BigQuery settings, you will need to provide additional permissions before connecting event tracking. Follow these steps for the process.
Get your service account email
- In your SegmentStream project, navigate to Settings → Events Tracking.
- Click on the Google Analytics 4 option.
- Select the account and property where your data is collected.
- Copy the service account email from the Google Analytics 4 connection settings.
Find the BigQuery project to which the Google Analytics 4 property is linked
- In your Google Analytics property, go to Admin.
- Under Product Links, click BigQuery Links.
- You will see the ID and name of the linked project.
Set permissions in your Google Cloud Account
- Go to the Google Cloud Platform Console.
- Open the console left side menu and click IAM & admin. Select IAM from the list.
- Click on the project selection menu in the navigation bar, and select the project linked to Google Analytics 4.
- Click GRANT ACCESS:
- Paste the service account email address into New principals field.
- Select the BigQuery Data Viewer and BigQuery User roles.
- Click Save.
Test connection and save
- Return to your SegmentStream project and navigate to the Google Analytics 4 connection.
- Click TEST CONNECTION.
- If the permissions have been correctly set up the SAVE button should be active, click it to complete your Google Analytics 4 tracking setup.