Market your business

How to use Google Analytics for Firebase

  1. Overview

    The challenge

    You’ll need to understand how your users behave with analytics reports, which enable you to make informed decisions regarding app marketing and performance optimizations. Your challenge is finding an effective way to gather and use this data without diverting too much time or resource from your business growth.

    Your aim

    Combine Firebase products to collect behavioral and marketing analytics data for your app.

    Google Analytics for Firebase is a free app measurement solution that provides insight on app usage and user engagement.

    At the heart of Firebase is Google Analytics for Firebase, a free and unlimited analytics solution. Analytics integrates across Firebase features and provides you with unlimited reporting for up to 500 distinct events that you can define using the Firebase SDK. How to go about it

    Firebase helps you develop high-quality apps, grow your user base, and earn more money. Firebase products work great individually but share data and insights, so they work even better together. This guide discusses Google Analytics for Firebase, which is a tool that helps you understand how people use your iOS or Android app, and can be useful wherever you’re growing your business.

  2. Google Analytics for Firebase

    Google Analytics for Firebase is a free app measurement solution that provides insight on app usage and user engagement.

    At the heart of Firebase is Google Analytics for Firebase, a free and unlimited analytics solution. Analytics integrates across Firebase features and provides you with unlimited reporting for up to 500 distinct events that you can define using the Firebase SDK.

    How does it work?

    Google Analytics for Firebase helps you understand how people use your iOS or Android app. The SDK automatically captures a number of events and user properties and also allows you to define your own custom events to measure the things that uniquely matter to your business. Once the data is captured, it's available in a dashboard through the Firebase console. This dashboard provides detailed insights about your data — from summary data such as active users and demographics, to more detailed data such as identifying your most purchased items.

    Analytics also integrates with a number of other Firebase features. For example, it automatically logs events that correspond to notification messages sent via the Notifications composer and provides reporting on the impact of each campaign.

    Analytics helps you understand how your users behave, so you can make informed decisions about how to market your app. See the performance of your campaigns across organic and paid channels to understand which methods are most effective at driving high-value users. If you need to perform custom analysis or join your data with other sources you can link your Analytics data to BigQuery, which allows for more complex analysis like querying large data sets and joining multiple data sources.

    Implementation path

    • Connect your app to Firebase

    Getting started with Analytics is easy. Just add the Firebase SDK to your new or existing app, and data collection begins automatically. You can view analytics data in the Firebase console within hours.

    • Log custom data

    You can use Analytics to log custom events that make sense for your app, like E-Commerce purchases or achievements.

    • Create audiences

    You can define the audiences that matter to you in the Firebase console.

    • Target audiences

    Use your custom audiences to target messages, promotions, or new app features using other Firebase features, such as FCM, and Remote Config.

  3. Get started with Google Analytics app reporting

    Create an account

    Go to firebase.google.com to create a Firebase account and download the corresponding SDK. To learn how to use the SDK in your app, refer to the Firebase documentation on Google Developers.

    Start collecting data

    After you integrate the Firebase SDK with your app, basic app-usage data is collected automatically and is available in Google Analytics and Google Analytics for Firebase. 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 lets you see how much time users spent with your app, how many users were active during a certain period of time, and how often in-app purchases were made. User properties are also collected.

    Tip

    Your app should log these general events and the events for your app type (e.g., retail and ecommerce, travel, or games). Logging events along with their prescribed parameters ensures maximum available detail in reports and lets you benefit from the latest Firebase features and integrations as they become available. To log events, you need to add additional code snippets to your app.

    See your reports

    After you create a Firebase account and integrate the Firebase SDK with your app, sign in to either Google Analytics or Firebase to see your reports.

    Google Analytics

    To see reports in Google Analytics:

    • Sign in to Google Analytics
    • Navigate to your app property. The report navigation will update to reflect the mobile app reports.
    • If you don't see your app listed in the Property selection menu, you need to add it.

      • Select Create new property from the Property menu.
      • Click Mobile app.
      • Select your Firebase app. If you don't see the app you're looking for, make sure you are an admin user for the app in Firebase.
      • Click Connect app. The report navigation updates to reflect the mobile-app reports.
    • Select the report you want from the report navigation (e.g., Dashboard, Events, Audiences).

    Firebase

    To see reports in Firebase:

    • Sign in to your Firebase account at firebase.google.com.
    • On the Welcome page, select your app.
    • In the left navigation, click Analytics.
    • Click the tab for the report you want (e.g., Dashboard, Events, Audiences).

    Events, conversions, user properties, and audiences

    There are four building blocks to app analytics: events, conversions, user properties, and audiences.

    • Events are triggered when users take actions in your app. Several events are captured automatically by the Firebase SDK. However, you need to add code to log the events for your app type. Logging these events along with their prescribed parameters ensures maximum available detail in reports and lets you benefit from the latest features and integrations as they become available.
    • Conversions are the events that matter the most to your business. Think of them as your key performance indicators (KPIs). Marking an event as a conversion lets you send these conversions to the ad networks you already work with, including Google and external networks.
    • User properties are characteristics of your users. Firebase captures several default user properties. You can also create your own. For example, if you want to track your users' favorite sports teams, create a team preference user property, and filter reports by team preference.
    • Audiences are segmented groups of users defined by a combination of events and user properties. For example, you might want to see metrics for just your users from a specific country.
  4. Logging events

    Events provide insight on what is happening in your app, such as user actions, system events, or errors.

    Analytics automatically logs some events for you; you don't need to add any code to receive them. If your app needs to collect additional data, you can log up to 500 different Analytics Event types in your app. There is no limit on the total volume of events your app logs.

    Automatically collected events

    Firebase collects these events by default. Automatically collected events are triggered by basic interactions with your app. As long as you use the Firebase SDK, you don't need to write any additional code to collect these events. To see event reports, click Events in the report navigation in Google Analytics, or click the Events tab in the Firebase console.

    Event name Triggered...
    ad_click when a user clicks an ad.
    ad_exposure when at least one ad served by the Mobile Ads SDK is on screen.
    ad_impression when a user sees an ad impression.
    ad_query when an ad request is made by the Mobile Ads SDK.
    ad_reward when a reward is granted by a rewarded ad served by the Mobile Ads SDK.
    adunit_exposure when an ad unit served by the Mobile Ads SDK is on screen.
    app_clear_data when the user resets/clears the app data, removing all settings and sign-in data.
    app_exception when the app crashes or throws an exception.
    app_remove when an application package is removed or "uninstalled" from an Android device.This event is different from the Daily uninstalls by device and Daily uninstalls by usermetrics, which are both reported by Google Play Developer Console. The app_remove event counts the removal of application packages, regardless of the installation source, and the count changes depending on the date range you are using for the report. The Daily uninstalls by device and Daily uninstalls by user metrics count the removal of application packages only when they were installed from Google Play, and are reported on a daily basis.
    app_update when the app is updated to a new version and launched again. The previous app version id is passed as a parameter.This event is conceptually different from the Daily upgrades by device metric, which is reported by Google Play Developer Console. An upgrade refers to the updating of the application binary, whereas an app_update event is triggered upon the subsequent launch of the upgraded app.
    dynamic_link_app_open when a user re-opens the app via a dynamic link.
    dynamic_link_app_update when the app is updated to a new version and is opened via a dynamic link. Android apps only.
    dynamic_link_first_open when a user opens the app for the first time via a dynamic link.
    first_open the first time a user launches an app after installing or re-installing it. This event is not triggered when a user downloads the app onto a device, but instead when he or she first uses it. To see raw download numbers, look in Google Play Developer Console or in iTunesConnect. in_app_purchase when a user completes an in-app purchase that is processed by the App Store on iTunes or by Google Play. The product ID, product name, currency, and quantity are passed as parameters. To see in_app_purchase data for Android apps, you need to link Firebase to Google Play. This event is triggered only by versions of your app that include the Firebase SDK. Note: paid app-purchase revenue, subscription revenue (Android only), and refunds are not automatically tracked. Your reported revenue may differ from the values you see in the Google Play Developer Console. Events that are flagged as being invalid or as sandbox (test) are ignored. Only iOS events are flagged as sandbox. Learn more about testing Google Play billing.
    notification_dismiss when a user dismisses a notification sent by Firebase Notifications. Android apps only.
    notification_foreground when a notification sent by Firebase Notifications is received while the app is in the foreground.
    notification_open when a user opens a notification sent by Firebase Notifications.
    notification_receive when a notification sent by Firebase Notifications is received by a device when the app is in the background. Android apps only.
    os_update when the device operating system is updated to a new version. The previous operating system version id is passed as a parameter.
    screen_view when a screen transition occurs and any of the following criteria are met:
    * No screen was previously set
    * The new screen name differs from the previous screen name
    * The new screen-class name differs from the previous screen-class name
    * The new screen id differs from the previous screen id
    session_start when a user engages the app for more than the minimum session duration after a period of inactivity that exceeds the session timeout duration.
    user_engagement periodically, while the app is in the foreground.

    General events that may apply to your app

    The following events are recommended for all apps.

    Tip

    When your app has features or behavior that correspond to Firebase events, you benefit from logging the events detailed here, as well as events for the app type (retail and ecommerce, travel, or games). Logging events along with their prescribed parameters ensures maximum available detail in reports and lets you benefit from the latest Firebase features and integrations as they become available.

    Event name Triggered... Parameters
    join_group When a user joins a group. Allows you to track the popularity of various clans or user groups. group_id
    login When a user logs in. sign_up_method
    present_offer When a user is presented with an offer. item_id, item_name, item_category
    search When a user searches in the app. search_term
    select_content When a user has selected content in an app. content_type, item_id
    share When a user has shared content in an app. content_type, item_id
    sign_up When a user has signed up. Allows you to see which methods of sign-up (e.g., Google account, email address, etc.) are most popular. sign_up_method
    spend_virtual_currency When a user has spent virtual currency (coins, gems, tokens, etc.) in the app. item_name, virtual_currency_name, value
    tutorial_begin when a user begins a tutorial. No parameters
    tutorial_complete When a user completes a tutorial. No parameters

    Once you’ve implemented the general events that apply to your app, you can add the specific events for your app type .

  5. Event reports

    You can view aggregated statistics about your Analytics events in the Firebase console dashboards. These dashboards update periodically throughout the day. For immediate testing, use the debug console output as described in the previous section.

    You can access this data in the Firebase console as follows:

    • In the Firebase console, open your project.
    • Select Analytics from the menu to view the Analytics reporting dashboard.

    The Events tab shows the event reports that are automatically created for each distinct type of Analytics event logged by your app:

    Summary table

    The table lists the events that were triggered in your app during your active date range.

    The table shows the following metrics for each event:

    • Count: number of times the event was triggered.
    • Users: number of users who triggered the event.

    Click an event in the table to see a detail report for that event. The information in each detail report varies according to the event.

    Event metrics

    The following metrics are provided for each event:

    • Event count: number of times the event was triggered.
    • Users: number of users who triggered the event.
    • Count per user: average number of times per user that the event was triggered.
    • Value: sum of all VALUE parameters supplied with the event. Use this context-sensitive metric to track any data that is valuable to your app (e.g., revenue, time, distance).

    The metrics reflect different information depending on the event. For example, Event count for first_open indicates the number of times the app was opened for the first time, while Event count for in_app_purchase indicates the number of times an in-app purchase occurred in the app.

    Enable events as conversions

    Conversions are your most important events. By designating an event as a conversion, you facilitate attribution reporting and postback capacity for that event. Additionally, conversion events are uploaded immediately by the SDK in order to make them actionable more quickly.

    You may add up to 15 events per project as conversions, in addition to the three default conversions (first_open, in_app_purchase, and ecommerce_purchase).

    To designate an event as a conversion:

    • In Analytics, navigate to your app.
    • Click Events, then click Network Settings.
    • In the row for the event, turn on the switch in the Mark as conversion column.

    Once an event has been enabled as a conversion, it is available in ATTRIBUTION > CONVERSION EVENTS. Attribution reporting begins for that event at the time you enable it as a conversion.

    To see Google Ads-attributed Conversion Events in your Ads attribution reports, link your Firebase project to Google Ads, and then import the Firebase Conversion Events to Ads (Tools > Conversions > Firebase).