To get started with App + Web 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.
Properties and Projects
In Google Analytics, the traditional advice I give clients is to create a new property for every website or user experience that you’ve created (note: this is different from creating a property for every domain, because sometimes a single website crosses multiple domains or subdomains without the user noticing).
In Firebase, there are two concepts you need to be aware of: “Projects” and “Streams”. Although you’ll notice that there are no “Properties” within Firebase, you can apply the same concept to a Firebase “Project” for Analytics purposes. And each project within Firebase can be made up of one or more “streams” of data, which typically include your iOS app, Android app and Website.
Imagine that you’re a retailer with a website and mobile app. 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 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 Firebase Project
First of all, when you set up Google Analytics for Firebase three things need to happen:
- You will need to create a Firebase project if you haven’t already done
- You will need a Google Analytics property that is linked to that Firebase project
- You will need to create data streams for each of your website and/or mobile apps
This is evolving rapidly, but at the time of this post there are two ways to get started: 1) a best way, and 2) a quick and simple way. I prefer the best way for reasons I’ll describe below, but I’ve done both and so I’m including the steps for each:
The Best Way to Set Up Google Analytics for Firebase
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). If you follow the quick way below you cannot go back and enable all of these features later! 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.
The Quick Way to Set Up Firebase Analytics
The benefit of the quick approach is that it is easy and doesn’t require a credit card, but the downside is that you will not be able to enable other Firebase services down the road (such as BigQuery). This is because when you follow these steps your Firebase project is not visible in the Firebase console, and there is now way to create a new project in Firebase and link it to the one you just set up (at least not at the time of this post). But, if you’re sure you will never use any Firebase or Google Cloud products (or even Data Studio), then feel free to proceed with these steps:
- All you need to do is go to your Google Analytics account and open the admin menu to create a new property. Here you’ll see three options, but you are really choosing between Universal Analytics and Firebase Analytics.
Select either “Apps and web” (if you are not using web you could select “Apps”, but I still suggest “Apps and web” because you get some other reports) and your new property (also known as a Firebase Analytics “Project”) is ready to go.
- Open your property settings and click “Data Streams” to begin setting up your streams.
Setting Up Data Streams
Once your GA 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.