Search
Clear search
Close search
Google apps
Main menu
true

Google Analytics for mobile apps

Use Tag Manager with Google Analytics and the Firebase SDK.

To get the latest mobile app reporting features in Google Analytics, use the Firebase SDK in your Android and iOS apps. Once enabled in your app, Google Analytics will automatically collect certain events and user properties. You can additionally log events and set user properties manually in your apps.

Google Tag Manager gives you the ability to modify, add, or block events after app has shipped using the Google Analytics (Firebase) tag. Tag manager also gives you the ability to deploy and modify additional Google and 3rd party tags in your apps, without having to rebuild your app. See the list of supported tags.

Implementation of Tag Manager for mobile apps is done through the Firebase SDK and requires setting up a new container in Tag Manager. Google Analytics for Firebase’s events, parameters, and user properties are all available as inputs to tags from within Tag Manager.

In this article:

Using Tag Manager, Firebase, and Google Analytics together

You can use Tag Manager to block or modify events before they are sent to Google Analytics from your Firebase projects. Use triggers (using Event Name and Event Parameter variables) to define which events should fire your tags. Trigger conditions are evaluated whenever an event is logged in the app.

To implement Tag Manager with your mobile projects:

  1. If you haven't done so already, get your app set up with Firebase:
    1. Install the Firebase SDK (Android | iOS).
    2. In the Firebase console, add your app to your Firebase project.
    3. Add Firebase Analytics to your app (Android | iOS).
  2. Create a Tag Manager account and configure a Tag Manager container.
  3. Add Tag Manager to your project (Android | iOS).

The Google Analytics for Firebase service in the Firebase SDK collects app usage data for you automatically. To access and analyze this data, sign in to Firebase and navigate to your Google Analytics for Firebase reports. As long as you are already using the Firebase SDK, you don't need to add any code to enable automatically collected events, such as how many first opens, session starts, or in-app purchases you’ve had. This allows you to see how much time users spent engaged with your app, how often in-app purchases were made, and how many users were active during a certain period of time. Note that the automatically collected events generated by the Firebase SDK and collected by Google Analytics cannot be modified.

Visit the Tag Manager developer documentation to learn how to get started with Android and iOS.

Modifying and blocking events with the Google Analytics (Firebase) tag

By default, events logged in your app with the Firebase SDK will be automatically sent to Google Analytics, even if Tag Manager is in use. Tag Manager allows you to modify and supplement your event tracking, even after your app has shipped, via the Google Analytics (Firebase) tag. This is especially useful in cases where event naming conventions may change between your app builds, and you want to collect consistent data between users that still have older versions of your app and users that have updated to the latest release.

IMPORTANT: Use the Google Analytics (Firebase) tag from Tag Manager only if you wish to augment events logged in Firebase by your developers.

Create the Google Analytics (Firebase) tag

Once an app has been configured to use Firebase and Tag Manager, you can create a container to manage tags for the app:

  1. Create a new mobile Google Analytics for Firebase container for Android or iOS.
  2. Select Tags → New.
  3. Click Tag Configuration and select Google Analytics (Firebase).
  4. Configure and save your tag.

Tag configuration

Using the Actions menu, you can modify, add, or block events.

  • Modify: Use the modify option to keep parameter names consistent between different versions of your apps. For instance, your Android implementation might have an event called save_image, and your iOS implementation uses save_new_image. You can edit parameter name in the Override Event Name field. Use Parameters to Add/Edit to add key names and values as necessary by clicking the Add Row button and entering the appropriate key names and values. Use the Parameters to Drop to drop key names from when the tag is fired.
  • Add: Use the add option when you want to measure another event at the same time as an already logged event. Use Parameters to Add/Edit to add key names and values as necessary by clicking the Add Row button and entering the appropriate key names and values. If you check the Merge the triggering event's parameters with the parameters defined below box, an additional Parameters to Drop field will appear where you may drop key names from when the tag is fired.
  • Block: Use the Block option when you want to prevent any manually logged events from being sent to Firebase Analytics. For instance, you might use this if a developer accidentally logged two events for the same thing, logged an event for something that shouldn't be logged, or logged too many unique event names (Firebase Analytics allows up to 500) and you want to prevent hitting that limit. Blocking an event will prevent the data from being sent to Firebase Analytics. Other triggered Firebase Analytics tags that are configured to add or modify events will still result in those events being sent.

Specify the event(s) that you'd like to take action on in the Triggering section.

Automatically collected events available in Tag Manager for Android and iOS

This table lists Google Analytics for Firebase's available automatically collected events for Android and iOS that are accessible from Tag Manager:

Event Android iOS
app_exception  
app_update  
firebase_campaign
first_open  
in_app_purchase  
notification_dismiss  
notification_foreground
notification_open
notification_receive  
os_update
session_start
user_engagement

Enable Universal Analytics in Firebase projects using Tag Manager

When you implement a mobile app using Firebase, you can activate a Tag Manager container for your app and then easily use Tag Manager to configure and deploy a Universal Analytics tag or any supported 3rd party tags.

Google Tag Manager supports mobile app reporting in earlier versions of Google Analytics. If you intend to implement tracking the previous generation of app reports, Google Tag Manager—in conjunction with Firebase—is the recommended method.

To set up a Universal Analytics tag via Tag Manager, follow these steps:

  1. If you haven't done so already, get your app set up with Firebase:
  2. Create a Tag Manager account and configure a Tag Manager container.
  3. Add Tag Manager to your project (Android | iOS).
  4. Create your Google Analytics tag in Tag Manager.

Once your app has been compiled with Firebase and Tag Manager, you can add any additional tracking tags from the Tag Manager interface with no need to rebuild your app.

Next Steps

Was this article helpful?
How can we improve it?