Analytics using Firebase and Facebook


                                                 Analytics using Firebase and Facebook

This blog page is for the person who says YES for at least one of these questions.Are you a developer?
Are you looking to analyze your business growth?
Are you looking to monetize your app?
Do you have an idea to build next great app/business and wants to analyze progressively?
There are so many questions like these which you might have. Here I am going to talk about the Analytical tools.


Why do we need Analytics?
There are many scenarios where we need analytical tools. Below are the few use cases.
To measure and track your result across time.
To understand user behavior and app performance.
To re-engage active/inactive users
To track your goals and conversion rate.
To look at a number of visits or hits.
The list goes like this.

There are many tools available for analytics. Depending on your business requirement you might go with the tools. Here I am going to talk about Firebase and Facebook.

Why do we need Firebase and Facebook both? Isn’t Firebase or Facebook alone enough?
You might have a question like this. I will answer these little later.

Let me start with Firebase and its feature first. You can find complete info on Firebase analytics website, here I am going to give you brief on this.

Firebase Analytics:
Firebase is based on the below principles and of course most of other analytical tools too.


We have to log the events as per our goal and the requirement. Try to capture as much as flows using events. Once you log, it will take few hours to show it on your dashboard. Based on the reports check whether you have reached your target or not. Analyze your checkpoints/goals and re-engage the user. That automatically leads well earning for you.

Google Certified Agency

1.Create project in the Google Firebase Console
2.Do initial setup. Follow the link
3.For analytics just use bellow library
compile ‘’
4.Initialize the analytics
// Obtain the FirebaseAnalytics instance.
FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
Firebase Analytics also integrates with a number of other Firebase features. For example, it automatically logs events that correspond to your Firebase Notifications and provides reporting on the impact of each campaign.
Sample Firebase reporting dashboard looks like as below


This Dashboard shows few features those would help us in analyzing the app/business.
-User properties

Events are the base of all analytical tools. So like other tool Firebase also offers event logging. Events are a basic block to visualize other features like Funnel, Attribution, Cohorts, etc.
Below are the few events that Firebase logs automatically for you.
notification_foreground notification_receive
notification_open notification_dismiss dynamic_link_first_open dynamic_link_app_open firebase_campaign

Along with these you can log your own custom events with the parameters.
Bundle params = new Bundle();
params.putString(“image_name”, name);
params.putString(“full_text”, text);
mFirebaseAnalytics.logEvent(“share_image”, params);

Fore information about event logging refer here

Funnels are very very important and best feature provided most of the analytical tools. Funnel are the series of events which leads to your goal. Funnels are an effective way to analyse the user behaviour and calculate conversion rate.
For example: Let say you want to track the user onboarding in your app. Assume that it involves 2 step for completion of signup. Now you can create Funnel which involves series of events like Step 1 (first_open) -> Step 2(RegistrationSuccess).
The view which looks like below will give you a clear idea where most of the users are quitting the flow or how many users reached the goal.



This is an important feature where you can segment users based on the business requirement. Let say I want to group user/audience who has added their credit/debit card to my app.

So when a create audience with event card_added then it will show activity across the timeline and total card added users.



You can use this feature to track any of your goals. Let say you are running a campaign on Adwords and you want to track the installation.
So, to do that click on “Mark as Conversion” in front of first_open or any of your custom installation event. Link your Adwords account to Firebase in the Attribution->Network settings.
Now onwards all your conversions will be synced to Adwords account.

User Properties:
User properties are attributes you define to describe segments of your user base, such as language preference or geographic location.
Refer this more information

Firebase offers a great feature where you can re-engage your segment of your user. You can send push messages to a user to make them more active.

There are many features like this that Firebase offers.

*Note Firebase is only for mobile application. If you want to track the web/server event also then you can integrate Google Analytics. But your Firebase events won’t be tracked in Google Analytics. So to track all your mobile/Firebase events in Google Analytics you need to integrate Google Tag Manager to achieve. This I will cover this in another blog.
To conclude briefly Firebase is a tool where you can collect and analyze your goals and user behavior. Also, you can re-engage the user to increase your app usage.

Facebook Analytics
Now let me move on to Facebook analytics.
You may be wondering why Facebook analytics required when we are integrating with Firebase (or any other analytical tools like Clever tip, MixPanel, etc).
So the reason is, like other analytics Facebook won’t share their analytics with any third party.
I mean if you are running ad campaigns on Facebook then those won’t be captured in Firebase or any other analytical tool. So if you are running campaigns on Facebook then integrating Facebook analytics is mandatory.

This is why I kept this blog title as “Analytics using Firebase and Facebook”

Facebook analytics feature are almost same as Firebase.

Below is the step by step process & reference link which will help your tech team to get integration in the place.

Step – 1: Download the Facebook SDK for Android
Step – 2: Login to using your desired ID(preferably not the same ID, which you intend to use as the Admin for the Ad Account, that way you avoid accidental changes taking place in the App environment)
Step – 3: Create a new Facebook App & a new App ID
Step – 4: Import the Facebook SDK into the Android App
Step – 5: Initialize the SDK

Add the below code each long-lived activities

protected void onResume() {

// for Android, you should also log app deactivation
protected void onPause() {
Facebook analytics supports upto 1000 unique event for your app. If you want to capture your own custom events then you can do so
AppEventsLogger logger = AppEventsLogger.newLogger(this);
// Add to a button click handler

For more details on Facebook analytics read here.


about the author