Google Analytics 4 (GA4) is the latest version of Google Analytics, designed for the future of measurement. It is a new kind of property that allows you to track websites and apps performance. Data collection and analysis are simpler when both website and app data are collected in the same account. To set up data collection for an app using GA4, you first need to have a Google Analytics 4 property and an app data stream setup.
Follow these steps to collect GA4 data using your app
- Create a Google Analytics 4 property.
- Create an app data stream.
- Add the Google Analytics SDK to your app.
- Configure the Google Analytics SDK.
- Collect data in Google Analytics.
Create a Google Analytics 4 property
To create a Google Analytics 4 property, go to the Google Analytics website and sign in to your Google account. Then, click the Create property button and select the App option.
Create an app data stream
Once you have created a Google Analytics 4 property, you need to create an app data stream. To do this, go to the Data streams tab in your property and click the Create data stream button. Select the App option and enter a name for your data stream. You also need to select your platform (iOS or Android).
Add the Google Analytics SDK to your app
The Google Analytics SDK is a set of code that you need to add to your app in order to collect data. The SDK is available for both iOS and Android.
To add the SDK to your app, follow the instructions in the Google Analytics documentation for your platform.
Configure the Google Analytics SDK
Once you have added the SDK to your app, you need to configure it. The configuration settings include your Google Analytics property ID and the data that you want to collect.
To configure the SDK, follow the instructions in the Google Analytics documentation for your platform.
Once you have your GA4 property and app data stream set up, you can start collecting basic app-usage data by adding the Google Analytics for Firebase (GA4F) SDK to your app (iOS or Android)3. The GA4F SDK includes the Play Install Referrer API. As long as your Android app has the SDK implemented, the client can append the utm_source and utm_medium in the referrer3.
With the SDK in place, a number of events are collected automatically. You also have the option to collect any recommended events that are relevant to your business. You can use the logEvent method to define and collect up to 500 different events, with no limit on total volume.
In addition to basic app-usage data, GA4 also collects enhanced measurement events (when enabled) from web data streams and in-app purchases from app data streams. By default, the SDK collects identifiers for mobile devices (for example, Android Advertising ID and Advertising Identifier for iOS) and uses technologies similar to cookies4.
On iOS, the SDK collects the Advertising Identifier (IDFA) if it is available. For the IDFA to be available, a developer has to link in the AdSupport.framework library and on iOS14.5+ receive user authorization from the App Tracking Transparency framework. If the Advertising Identifier is unavailable, the SDK collects the Vendor Identifier. If the Advertising Identifier becomes available after the Vendor Identifier was reported, the SDK stops collecting the Vendor Identifier4.
On Android, the SDK collects the Advertising ID by default. For the Advertising ID to be available, a developer has to include the com.google.android.gms.permission.AD_ID permission in the SDK’s manifest file. To collect the Advertising ID, the SDK includes the com.google.android.gms.permission.AD_ID permission in the SDK’s manifest, which automatically merges into the app manifest by the Android build tools. The Advertising ID is removed when a user opts out of personalization using advertising ID in Android Settings. Any attempts to access the identifier will receive a string of zeros instead of the identifier4.
Setting up GA4 data collection in an app involves creating a GA4 property and an app data stream, adding the GA4F SDK to your app, and implementing any relevant events or measurements that you want to track. With these steps completed, you’ll be able to collect valuable data about your app’s usage and performance.
Need help with GA4?
Contact us at email@example.com or fill out the form at the Contact Us page