How to Set Up a Google Analytics 4 Property
To get started with Google Analytics 4 you’ll want to create a new Google Analytics property, and then set up data streams for each of your websites and/or apps.
I strongly encourage my clients to read through this document before starting this process! You can find Google’s instructions on this process here, but if you’re not careful during setup you might make some irreversible mistakes! This post will familiarize you with the concepts and what is happening behind the scenes when you walk through the setup process.
Updated to reflect changes to integrating BigQuery with a GA4 property.
Accounts, Properties and Projects
The standard way to set up accounts is 1 account per business. Each account can have 100 properties (source), so if your business needs more than 100 properties you will need to create multiple accounts.
Properties in Google Analytics (all versions), the advice I give clients is to create a new property for every website or user experience that you’ve created. This is different from creating a property for every domain, because sometimes a single website crosses multiple domains or subdomains without the user noticing.
With Google Analytics 4 (and Firebase Analytics), there are two concepts you need to be aware of in addition to "property": “Projects” and “Streams”. A "project" in Firebase Analytics corresponds to a "property" in Google Analytics 4, and you can apply the same concept in the paragraph above to both. Data flows into a property through a "stream". Each GA4 property (or project within Firebase) must have at least 1 stream, but can have up to 50 (one for each iOS app, Android app or Website).
Imagine that you’re a retailer with a website and mobile app (iOS and Android). Regardless of which device a user is running the experience will share a common structure: a homepage, a search results page, product category pages, product detail pages, and a checkout flow. Since the user’s experience is duplicated (at least roughly) across each platform, you can stream data from each into a single database (or Firebase project) so that it can be rolled up or filtered by stream in reports. Each project may contain up to 50 different data streams (source).
BEWARE: When you’re in the implementation phase later, it’s very important that the data you collect in each stream is identical so that it can be rolled up in your reports. This is a very common problem and it can be difficult to fix, so be very careful to name events and parameters consistently across streams (including case).
Setting Up a New Google Analytics 4 Property
First of all, when you set up a Google Analytics 4 property you have to decide if you want to link this property to a Firebase project? The benefit of linking a GA4 property to a Firebase project is that it will allow you to take advantage of other Firebase products. If you have an app then it's a good idea to do this.
This may change eventually, but if you think you may ever want to link Google Analytics 4 with a Firebase project then you need to follow OPTION 1 below. If you're just setting up GA4 for a simple website then this is probably not necessary, and you can skip to OPTION 2.
OPTION 1: Set Up Google Analytics 4 with a Firebase Project
This approach fully enables all of the services you will need, and sets up a billing account in case you later decide to use a product that has an associated fee like the BigQuery integration (Firebase Analytics is free). To do this, follow these steps:
- If you haven’t already, create an account in Google Analytics
- Go to Google Cloud Console and setup a new project with a billing account
- Open the Firebase Console, click “Add Project” and select the project you just created in the Google Cloud Platform. You will then be prompted to link your Firebase project with a Google Analytics account.
- Finally, open Google Analytics and take a look at the new property that has been created for you (it will have the same name as your Google Cloud project ID). Open your property settings and click “Data Streams” to begin setting up your streams (more on that below).
You can now manage the integration between Google Analytics and Firebase from the settings in your Firebase project.
OPTION 2: Set Up Google Analytics 4 without Firebase
Before we get started with option 2, here is the caveat with this approach: If you choose to link your Google Analytics 4 property with Firebase at a later point in time after following the steps below, your streams will not appear in the Firebase project. As a result, only follow these steps if you are certain that you will never want to use Firebase.
All you need to do is go to your Google Analytics account and open the admin menu to create a new property. By default this will create a Google Analytics 4 property, but you can still create a Universal Analytics property by expanding the advanced options (don't do this).
Open your property settings and click “Data Streams” to begin setting up your streams.
Setting Up Data Streams
Once your GA4 property has been created it’s time to start streaming data into it. For mobile apps this just means following the steps to add Firebase to each app, but when you stream data from a website you have a very cool new option called “Enhanced Measurement”.
Enhanced measurement adds some basic tracking beyond the typical pageview that you previously got when deploying Google Analytics on a site, such as: scroll tracking, video interactions, and clicks to download files. Items on this list that are irrelevant to your business should be disabled because they will add unnecessary code to your site, but definitely take advantage of these where they make sense.
Where is My Tracking ID?
Now that you’ve set up a new property and web stream, you may be wondering where your “UA-” number is (also known as the property ID or tracking ID). When you set up a web stream, the concept of a “UA-” number is replaced with a “Measurement ID”. The measurement ID takes the form of “G-XXXXXXXXXX”, and it is used to identify your stream. If you’ve already installed GTM or the gtag, then you can add this measurement ID to your settings without needing to change any code on your site.
For GTM Users: When you’re ready to start collecting data, you’ll just add this measurement ID to the “App + Web Configuration” tag in Google Tag Manager. You can learn more about this in my post on Setting Up Your First Page_View in GTM.
For gtag Users: If you’re using the gtag, go to: Admin > Tracking Info > Tracking Code and click “Connected Site Tags” under “Global Site Tag” to connect this measurement ID.