Understanding Data Streams in Google Analytics 4
The upgrade to Google Analytics 4 (GA4) brings with it numerous changes and improvements, including entirely new features as well as updates to existing features. Data streams are one of these new features that both replace and improve functionality present in previous versions of Google Analytics.
This article explains what data streams are in Google Analytics 4, how to set them up, and some things you should keep in mind when working with them.
What is a data stream in Google Analytics 4?
Google Analytics 4's data streams are the means by which usage data is collected from your websites and apps and imported to the Google Analytics platform. There are three different types of data stream:
- Website
- Android app
- iOS app
You’ll need to connect each of your applications to the correct type of data stream when setting up your Google Analytics properties. Each property can have up to 50 data streams, including up to 30 data streams from apps.
Data stream sources in Google Analytics 4Many modern web products include multiple websites and apps. By allowing you to group data collected from multiple data streams in a single property, and using intelligent identity resolution through machine learning, Google Analytics 4 can track user behavior across platforms and sessions in a single reporting interface. This is a major improvement over the previous version of Google Analytics (known as Universal Analytics), in which you had to create isolated properties for each platform type (websites vs. mobile apps). While this requires more initial planning and setup, it also provides a unified interface to analyze user interactions across these platforms in one place rather than keeping one user’s app and web activity separate.
How to set up a data stream in GA4
If you’re new to Google Analytics, you should start using Google Analytics 4 from the outset, and you’ll need to set up data streams for all of the apps and websites you wish to track your visitors and users across. Without data streams, Google Analytics cannot collect the data it requires.
If you’re an existing user migrating from the previous version of Google Analytics (Universal Analytics), you should set up your properties in GA4 as soon as possible. The move to Google Analytics 4 is mandatory, and Universal Analytics will stop collecting data in July 2023 (July 2024 for Google Analytics 360 subscribers). As data from Universal Analytics cannot be migrated to Google Analytics 4, it’s worth taking the time to set up your data streams now, so that as much data is available to GA4 and its new tools when Universal Analytics is discontinued.
Step-by-step: how to set up data streams
Setting up data streams in Google Analytics is a straightforward process, but it’s different from setting up properties in Universal Analytics, so existing users will need to be aware of the new process.
When creating a data stream, a snippet of code or configuration file is generated that uniquely identifies your data stream to Google Analytics, and performs the data collection. Google Analytics will start collecting data from the time the snippet is added to your app or website's source code (and once some visitors have begun interacting, providing events for your data stream to transmit). Once your data streams have begun collecting data, you can start exploring it through Google Analytics' reporting and visualization tools.
The first step to adding a data stream is to go to the Google Analytics admin console and create a property. Once your GA4 property has been created, you can create data streams by clicking on Data streams and then Add stream.
Next, you’ll need to select whether you’re setting up a stream for a website, iOS app, or Android app. The steps will diverge here depending on which you need.
Data streams for iOS and Android apps
To continue setting up your data stream for an iOS or Android app, enter your iOS app's bundle ID or your Android app's package name and then click Register app.
You’ll then be able to download a configuration file unique to your app, and you’ll be provided with instructions on how to add the Google Analytics for Firebase SDK to your application's code.
Google Analytics relies on Google Firebase to collect data from mobile apps, and will automatically create a Firebase project and link it to your Google Analytics Property if a linked project is not already present.
Data streams for websites and web apps
To continue setting up your data stream for a website or web app delivered via a browser, enter the base URL of your website (for example, rudderstack.com) and a name for the new data stream. You will be asked whether you want to enable enhanced measurement (explained later in this article), and then you’ll be presented with a code snippet that you need to paste into the HTML source of your website, directly under the opening <head> tag. It is important to note here that the website URL you give is cosmetic and not functional, meaning you can send data from a different domain (such as a completely different e-commerce domain) into this property and it will work without issues.
If you are using a CMS or hosted e-commerce solution, you may not have access to the source code and will need to add the tag using an alternate method.
Once your app and website data streams are set up, you should test them by interacting with your website or app and ensuring that those interactions appear in the Google Analytics console to confirm that everything is hooked up correctly.
User interaction events recorded in the Google Analytics consoleWhat are enhanced measurements in GA4 data streams?
When creating a data stream for a website, you are given the option of enabling enhanced measurements, which can also be enabled after a property has been created. When enhanced measurements are enabled, Google Analytics collects a pre-selection of measurements so that it can immediately start reporting on the common user interactions that provide actionable information for website owners. These measurements include page views, video plays, outbound link clicks, file downloads, and site searches.
For both websites and mobile apps, a variety of event parameters are automatically collected, including language, screen resolution, and the location, referrer, and title for viewed pages. Additional metrics for tracking your app users can be enabled at any time, and custom events can be implemented if you require information that’s specific to your business.
It’s important to be aware of what data you’ve configured Google Analytics to collect about your users, only enabling the collection of data that you have their consent to collect. Check the terms of use for Google Analytics, the terms for any services you connect to it, and any privacy regulations that cover you or your users, and make sure you’re not intentionally or unintentionally collecting any personally identifiable information that contravenes them.
How to set up cross-domain tracking in Google Analytics data streams
Data streams allow you to collect user data from multiple sources like a website domain, or your mobile apps, all in one place. If you provide multiple online services or a single service that spans more than one domain, you may want to set up cross-domain measurements, so that you can track the activity of your users across multiple domains.
To enable cross-domain tracking, navigate to the Configure tag settings section of your web data stream, and then to Configure your domains. Under Include domains that match ANY of the following conditions, add the domains you wish to track together.
You’ll need to repeat this process for any other data streams that you want to include in your cross-domain tracking. Make sure that the same tag ID (the same G-ID) is used in the HTML snippet for the pages on each domain you wish to track your users across.
Other things to consider when working with data streams
Any change in the behavior of a tool that your business relies on can be disruptive. Fortunately, as Google Analytics 4 is rolling out while Universal Analytics remains available, you have time to get familiar with the new changes before you rely on the latest version for your production data pipelines. Below are some of the things that you should consider during your migration to Google Analytics 4, to get the most out of both the platform and the data it collects.
New Google Analytics features
Google Analytics 4 comes with powerful new data collection and analysis features, as well as revising existing features to meet modern analytics requirements and emerging data privacy concerns. You should get acquainted with these new features so that you can fully leverage them when you upgrade to the new version.
Timezones and currencies
In GA4, timezone and currency settings are configured per property. If your business has a global presence, with employees or teams in different time zones, ensure that they’re aware of this so that data is not misinterpreted. Data streams and reports are based on a single timezone and currency, so it is important that you configure them for the primary audience you’ll be collecting data from, as you cannot create views displaying different currencies from the same data source.
Limits to custom metrics and dimensions
You are limited to 50 custom metrics and dimensions on standard properties in Google Analytics 4. If you require metrics and dimensions beyond those included by default in GA4, you should consider what and how many of these are required and try to optimize them so that you can split them across properties that each contain the data streams that require them.
If you require more custom dimensions or metrics, you can either pay for Google Analytics 360 (which allows up to 125 customer metrics/dimensions) or create multiple properties, each containing the custom metrics/dimensions required for the data they collect.
Rigid industry categories
When creating properties in Google Analytics, you specify the industry category for that product. These predefined categories aren't always a good fit for businesses that span multiple industries or are niche enough that their industry is not listed. Unfortunately there’s no real way around this, so you should select the category that best fits your business, which will be used for things like suggesting audiences and benchmarking reports.
Data sampling rate limits
The sampling rate limit used for data explorations has been greatly increased in Google Analytics 4. There’s now a limit of 10 million events per query for standard users, and a 1 billion event limit for paid Google Analytics 360 users. These limitations are per property, so if you’re dealing with large amounts of data and want more accurate results, you can split your data streams across properties or reduce the timespan a report covers to avoid these limits.
Access and permissions
In Google Analytics 4, data can no longer be split into separate views with fine-grained permissions — permissions can only be granularly set at the property level or above. To restrict access to selected data for specific users, you’ll need to create separate properties containing only the data stream you wish to share with those users, and limit what data is collected.
Preserving data from deleted streams
If you delete a Google Analytics 4 data stream, the historical data is preserved, but will undergo no further processing. Deleted streams cannot be used to filter reports, or as dimensions when adding comparisons.
Analytics data and legal compliance
It’s your responsibility to remain compliant with any privacy laws that cover you and your users. To assist with compliance, you should collect only the data your business requires, and seek consent from your users when collecting any potentially personally identifiable information (PII). Generally speaking, it is considered best practice to not send any PII data to Google Analytics in the first place but store them securely and limit access in your organization to them as much as possible. This means potentially modifying your GA4 data collection tags to prevent picking up PII data from the user’s current URL accidentally. For example, sending page view data for https://www.domain.com/password-reset?email=john.doe@domain.com is not OK.
Make sure you are aware of how Google Analytics collects, processes, and stores data, and how permissions are granted. In Google Analytics 4, data can no longer be split into separate views with fine-grained permissions — permissions can only be granularly set at the property level or above. Take this into account when setting permissions on your data streams, so that you don’t accidentally mishandle data or disclose information to unintended recipients.
Fully leveraging your data streams with a customer data platform (CDP)
Data streams in Google Analytics are the mechanism that collects data from your websites and apps, making it available for use with Google Analytics' inbuilt analysis and reporting tools. While these tools are user-friendly, they’re constrained in their scope, and many businesses find them limiting as their data requirements increase. Google also imposes restrictions on how much and how long data can be stored and may further tweak these restrictions in the future, keeping the data you’ve invested in collecting out of your complete control.
By taking full ownership of the data you collect through your Google Analytics data streams, you can ensure that the maximal value is extracted from it. A customer data platform (CDP) takes data from multiple sources — including Google Analytics — and transforms it into a consistent, readily reportable format suitable for long-term storage in your own data warehouse.
Data stored on your infrastructure is under your full control, for long-term use under your own terms. You are then free to blend your Google Analytics data with your own data or data from other sources, and use your own tools to analyze, report on, and visualize your data without limitations.
You don’t have to rely on Google for data collection and analytics
Taking full advantage of GA4 requires going deeper into the Google ecosystem. Download our guide to replacing GA with analytics on your warehouse to learn how to take control of your data for deeper, more reliable insights.Build a data pipeline in less than 5 minutes
Create an accountSee RudderStack in action
Get a personalized demoCollaborate with our community of data engineers
Join Slack Community