Affiliate links on Android Authority may earn us a commission.Learn more.
Get to know your audience better with Firebase Analytics
August 08, 2025
If you haven’t taken a look at the Firebase developer platform yet, then you should, as it’s shaping up to be a swiss army knife of tools aimed at helping you better understand your users. And the more you know about the people who are using your app, the better decisions you can make about how to keep them happy!
In this article I’m going to show you how to add Firebase features to your Android app. The Firebase platform includes a wide range of services, but I’m going to focus on Firebase Analytics as – with very little setup – this service can gather lots of useful information about how users are interacting with your app, as well as give you some insight into who exactly is using your application. Think of it as the mobile app equivalent of Google Analytics!

The best bit is that once you’ve setup your project to support Firebase, it’s easy to add additional Firebase features, such as Firebase Cloud Messaging (FCM) and Firebase Notifications, which is a service that allows you to send notifications to specific segments of your user base. So, by the end of this article not only will you have Firebase Analytics up and running, but you’ll have a project to which you may easily add additional Firebase features.
Why you should care about Firebase Analytics
Firebase Analytics tracks two types of data:
Firebase Analytics logs various events and user properties automatically, so once you’ve added Analytics to your project you don’t need to write any additional code – Firebase will start recording events and user properties, and this data will appear in your online Firebase Console, as if by magic.
The events that Firebase Analytics tracks automatically are:
Analytics also automatically tracks some behaviour related to Firebase’s dynamic links. Dynamic links are smart URLs that can help you provide a better experience for your users, by displaying different content depending on the user’s device.
These events are:
Firebase Analytics also automatically reports on several events that are related to Firebase Notifications. The Firebase Notification service allows you to send targeted messages to specific segments of your user base – a well-timed notification can be just the thing for re-engaging a user who hasn’t launched your app in a while, for example you could send them a notification about some new features they might want to try, or offer them a free upgrade.
Firebase Analytics automatically tracks several notification-related events:
If you want to track an event that Firebase doesn’t support by default, you can always create custom events. However, information related to these events won’t appear in Firebase Analytics – you’ll need linkyour app to a BigQuery projectin order to access this information.
Setting up Firebase
Before we get started, open the Android SDK Manager and verify the following packages are up to date:
You should also be running Android Studio version 1.5 or higher.

In order to use Firebase features in your app, you’ll need a Firebase project and a Firebase configuration file. Since we’re already logged into the Console, let’s take care of these two things now:
The Firebase configuration file (google-services.json) will now be downloaded to your computer. You need to add this file to your Android project, so flick back to Android Studio and make sure you have the ‘Project’ view open.

Drag the google-services.json file into your project’s ‘app’ folder.
Open your project-level build.gradle file and add the google-services plugin to the dependencies section:
Next, open your module-level build.gradle file and add the plugin to the bottom of this file:

You’ll also need to add the dependencies for the Firebase library (or libraries) you want to use. There’s ten libraries in total, but since we’re focusing on Firebase Analytics I’m only going to add the firebase-core library:
Since you’ve updated your Gradle files, perform a Gradle sync, either by selecting ‘Sync Now’ from the bar that appears, or by selecting ‘Tools > Android > Sync Project with Gradle Files’ from the toolbar.

Nip back to your browser and click the ‘Finish’ button to let Firebase Console know that you’ve completed this part of the setup process.
Adding Firebase Analytics
Now you’ve added the Firebase SDK to your project, you’re able to start adding specific Firebase services – including Firebase Analytics.
To add Analytics to your project, open its MainActivity.java file, declare the Firebase Analytics object and initialize it in your project’s onCreate() method:
Accessing your data
you’re able to view all of your Analytics data in the Firebase Console, which is updated periodically throughout the day:
This tab contains the following information for each event:
Check that events are being logged properly
It can take up to 24 hours for data to start appearing in the Firebase Console – that’s a long wait to find out whether you’ve setup Analytics correctly! If you don’t fancy waiting 24 hours, you can test whether your app is logging Firebase events correctlyright now, by enabling verbose logging and then checking the log messages that appear in Android Studio’s ‘LogCat’ tab.
Before you start, verify the app you want to test is installed on either an attached Android device or an Android Virtual Device (AVD). You’ll also need to issue some Android Debug Bridge (adb) commands, so open your Mac’s Terminal (or Command Prompt if you’re a Window’s user) and change directory (cd) so it’s pointing at your computer’s platform-tools folder. For example, my command looks like this:
Android Studio will start tracking logs from this point onwards, so restart your app. Then, run the following commands:
Back in Android Studio, select the ‘Android Monitor’ tab along the bottom of the screen, followed by the ‘LogCat’ tab.
All the information about your Firebase events will now appear in LogCat (along with a bunch of other messages, so you may want to filter the LogCat output). Spend some time triggering different events in your app, and reading through your LogCat messages to make sure these events are being logged correctly.
Once you have integrated Firebase you should be able to better understand your users. With the information you may discover more about the people who are using your app and make better decisions to keep them happy. What’s your opinion of the relaunched Firebase and Firebase Analytics? Will you be using it to analyse your app’s performance?
Thank you for being part of our community. Read ourComment Policybefore posting.