Hello There!

Lorem ipsum dolor sit amet, consectetur adipiscing elit,

How to Leverage Firebase Analytics & BigQuery Integration for Advanced Analysis

Integrating Firebase with BigQuery provides you the ability to perform deeper insights into your data by writing SQL queries. It can help you answer many questions about how your apps are performing and being used. 

Also Read: Getting Started with Firebase Analytics

Linking your Firebase project to BigQuery lets you access raw, unsampled event data of your Firebase project along with all of your parameters and user properties.

Note that you need to have a Firebase Blaze plan in order to link it with BigQuery. With free tier, i.e Firebase Spark Plan the export of data is not possible.

There are two prerequisites for enabling export. First, within Firebase your account needs to be an Owner of the project that you want to link, and second, on Google Cloud Platform project, that same Google account needs Project Owner access.

You can configure Firebase to export data to BigQuery from the following Firebase products:

We will be considering Analytics data for our example. Once the export is successful, under the BigQuery console we will have a dataset named analytics_xxx where xxx is the property for your Firebase. Under this analytics_xxx dataset a table is imported for each day of export. These tables have the format “events_YYYYMMDD” and are sharded tables. Additionally, a table is imported for app events received throughout the current day. This table is named “events_intraday_YYYYMMDD” and it is populated in real-time as app events are collected.

If we want to Analyze Firebase Analytics data in-depth to find meaningful insights & patterns Firebase and BigQuery integration is required. This opens doors to advanced analysis such as Closed Funnel, Revenue/Monetization, Ad Performance, In-App Purchases, Top Performing Features, User Lifetime Value, user churn pattern, etc. since raw level data is collected in BigQuery.

Sample dashboards (DataStudio) 

We will create two dashboards:

  1. Churn Users 
  2. Users Funnel Drop off 

Here is the query for churn users:

with level_sucessful as 

(

  select * from (

   select event_date,user_pseudo_id, event_timestamp, country, 

   CAST(level as INT64) level, CAST(Cash_Money as INT64) Cash_Money , CAST(Bonus_Money as INT64) Bonus_Money

   ,row_number() over(partition by user_pseudo_id order by event_timestamp desc) as row_number 

   from( 

       SELECT event_date, event_timestamp , user_pseudo_id , app_info.version , geo.country , event_name, 

        IF(ep.key=’Level’, ep.value.string_value, null) AS level ,

       IF(ep.key=’Cash_Money’, ep.value.string_value, null) AS Cash_Money ,

       IF(ep.key=’Bonus_Money’, ep.value.string_value, null) AS Bonus_Money 

       FROM `Project-ID.analytics_xxx.events_*` ,unnest(event_params) ep

       WHERE event_name = “Level_Completed” 

   )

 ) where row_number=1

), 

user_app_remove as (

 SELECT event_date, user_pseudo_id 

 FROM `Project-ID.analytics_xxx.events_*` 

 WHERE event_name = “app_remove”

)

 SELECT ar.event_date,ar.user_pseudo_id,ls.country,ls.level Level,ls.Cash_Money, ls.Bonus_Money 

FROM  user_app_remove as ar JOIN level_sucessful as ls

 ON ar.user_pseudo_id = ls.user_pseudo_id

Now, for churn users dashboard we want the level at which users uninstall the app and the amount of cash money and bonus money they have. So that we can identify the level that can be improved and identify the common drop off points.

The event app_remove is a default event of Firebase and users level, cash money and bonus money are being passed with Level_completed. Hence, we will join the latest level completed by the users just before removing the app.

We save results from the query into a table named churn_users and then connect it to DataStudio for generating wonderful insights.

Dashboard:

Firebase-BQ

Query for funnel:

with funnel_data as

(

  SELECT event_date,event_timestamp,user_pseudo_id,geo.country,event_name

      FROM `Project-ID.analytics_xxx.events_*` 

WHERE

  event_name IN (“Payment_details_entered”,”Add_to_Cart”,”Order_Confirmation”)

  UNION ALL

      FROM `Project-ID.analytics_xxx.events_*`  , UNNEST(event_params) event_params

WHERE

  event_name = “Shipping_Details” AND event_params.key = “From” AND event_params.value.string_value = “In Game”

),

 

Add_to_Cart as 

( SELECT  event_date,country ,user_pseudo_id FROM funnel_data 

  where event_name = “Add_to_Cart” AND country != “”

)

,Shipping_Details as 

(

    SELECT event_date, country,user_pseudo_id FROM funnel_data  

    where user_pseudo_id in (select distinct Add_to_Cart.user_pseudo_id  from Add_to_Cart ) 

    AND event_name = “Shipping_Details” 

    

),

Payment_details_entered as 

(

  SELECT event_date,country,user_pseudo_id FROM funnel_data

  where user_pseudo_id in (select distinct Shipping_Details.user_pseudo_id  from  Shipping_Details) AND event_name = “Payment_details_entered”

),

Order_Confirmation as 

( 

  SELECT event_date, country ,user_pseudo_id FROM funnel_data 

  where user_pseudo_id in (select distinct Payment_details_entered.user_pseudo_id from  Payment_details_entered) and event_name = “Order_Confirmation”

),

Add_to_Cart_with_cnt as 

(select event_date,country,count(user_pseudo_id) Add_to_Cart_cnt from Add_to_Cart 

group by 1,2) ,

Shipping_Details_with_cnt as 

(select event_date,country,count(user_pseudo_id) Shipping_Details_cnt from Shipping_Details 

group by 1,2),

Payment_details_entered_with_cnt as 

(select event_date,country,count(user_pseudo_id) Payment_details_entered_cnt from Payment_details_entered

group by 1,2),

Order_Confirmation_with_cnt as 

(select event_date,country,count(user_pseudo_id) Order_Confirmation_cnt from Order_Confirmation 

group by 1,2),

 

 

Add_to_Cart_and_Shipping_Details as 

(select s.event_date ,s.country ,Add_to_Cart_cnt,if(Shipping_Details_cnt is null,0,Shipping_Details_cnt) Shipping_Details_cnt from Add_to_Cart_with_cnt as  s

left join Shipping_Details_with_cnt as i 

on s.event_date = i.event_date AND s.country =i.country ),

 

Add_to_Cart_and_Shipping_Details_and_Payment_details_entered as 

(

  select s.*,if(Payment_details_entered_cnt is null,0,Payment_details_entered_cnt) Payment_details_entered_cnt from Add_to_Cart_and_Shipping_Details as s

  left join Payment_details_entered_with_cnt i

  on s.event_date = i.event_date AND s.country =i.country

),  

Add_to_Cart_and_Shipping_Details_and_Payment_details_entered_and_inAppPurchase as 

( 

  select s.* ,if(Order_Confirmation_cnt is null,0,Order_Confirmation_cnt) Order_Confirmation_cnt from Add_to_Cart_and_Shipping_Details_and_Payment_details_entered as s

  left join Order_Confirmation_with_cnt i

  on s.event_date = i.event_date AND s.country =i.country 

)

 

select * from Add_to_Cart_and_Shipping_Details_and_Payment_details_entered_and_inAppPurchase 

 

For the user funnel dashboard, we want a closed funnel for purchase which goes like this Add to Cart > Shipping Details > Payment Details > Order Confirmation. Thus, it will help us identify where our users are being dropped while performing the confirmation.

Now, the query for the closed funnel is quite tricky. The logic goes like this: what is the number of users that performed add to cart event out of this how many performed the shipping details activity again out the shipping details how many users get into the payment details process and finally to order confirmation.

Hence, for the query logic, we use “WITH AS” and first create a master table named funnel data with the respected events after which we list out the number of users for the Add to Cart event. While creating the Shipping Details we apply the filter for users from the add to cart and for Payment details entered we apply the filter for users from the shipping details temporary table and so on. Finally, we count the users for respected events in each temporary table thereby joining them. 

Dashboard:

Firebase-BQ

Now using this table, we have created a sample dashboard to understand the user drop off from the add to cart and we can see a high drop off rate at all the steps

Possible reasons for this could be that page load issues, payment issues, shipping details form load issues, lengthy form to complete the checkout, payment gateway issues, fewer options for payment, etc. We can also map specific user behavior against this funnel

Depending on your business KPI, custom events and parameters can be created and then queried in BigQuery to fetch raw-level data to in turn visualized in Data Studio.

Great so now that we have all the rich information and insights in front of us the obvious question is “So what? What can I do with all the data that I have?” One of the main closing points here would be the activations that be done using Firebase because insights without any action is an investment with zero ROI.

Mobile App Analytics: Get started with Firebase

Firebase is seeing traction and conversation around it as Google recently started to sunset Google Analytics mobile-apps reporting based on the Google Analytics Services SDKs, for both Android and iOS.

Firebase has a generic perception of being ‘just an analytics tool’ around it, it can be much more than that.   

Data is oriented around events instead of screen views. Firebase is Google’s mobile and web application development platform where you can

  • Build your app
  • Improve app quality
  • Analyze user behavior 
  • Grow your business

Now, there are multiple tools in the market for App Analytics and you all must be using one of these tools for your business. Each tool has its own way of engaging customers using various marketing techniques and experimenting with user experience. Some of these tools can even engage with the customers directly via WhatsApp messaging.

But, when it comes to handling campaign attributions, they are not quite there yet. All these tools have attribution data based on the rule-based attribution models and they don’t provide advanced attribution capabilities like data-driven attribution and assisted conversions within the tool. 

In such a scenario, Firebase has the advantage of seamlessly integrating with BigQuery and providing raw data of analytics where I can build custom attribution models that are data-driven and also create insightful reports for assisted conversions and conversion paths. 

What type of analysis/reporting is possible using Firebase?

 width=

As we just saw that Firebase is more than just an analytics tool. The following are the Reporting possibilities within Firebase Analytics

  • Dashboard: Summarizes the tracking data in all other reports in a single view
  • Events: This report collects all the user actions on the app
  • Conversions: Check the attribution report for each conversion event
  • Audiences: These are a segment of users with similar behavior
  • Funnels: See how your users move from one step to another on the app
  • User Properties: User-level dimensions like Age, Gender, and other custom defined ones
  • Latest Release: Avoid any code errors or issues with the help of this real-time report
  • Retention: A cohort analysis of the users and how they behave over a week
  • Stream View/Debug View: Realtime data for instant study as well as debugging for any issues

Need for advanced analytics (tool limitation such as event parameter - text/numeric)

Given certain reporting limitations, it is important to link Firebase with BigQuery so that we can capture additional data points in BigQuery and visualize the same in DataStudio. Limitations noted below

Events: 

  • Limit of 500 unique events per app and 25 parameters for a single event
  • In App+Web, register a maximum of 100 parameters in Firebase to drill-down based on event parameters (50 texts and 50 numeric parameters)
  • If only Firebase Analytics is used, a maximum of 50 custom parameters (10 texts and 40 numeric) can be used across 500 events. This means we can spread out the 50 custom parameters across 500 events and a point to note here is that repeated parameters are counted twice.

Audiences:

  • Limitation of creating maximum 50 Audiences and these are not retroactive

Funnels:

  • Funnels in Firebase are Open Funnels and a limit of 200 per project applies

To know more about the Advanced Analysis on Firebase and get your hands on 2 Plug and Play Sample queries curated by Tatvic, we’ll be publishing part 2 of the blog. 

How to Track App Unintals in IOS & Android using Firebase? - Part 1/2

Blog App Uninstall Feaure Image

Blog App Uninstall Feaure Image

App uninstalls are the easiest thing to do on our smartphones, right? Enough blogs have mentioned the reasons behind these app uninstalls and a multitude of companies have done surveys too, reporting to reach at 10 worst reasons causing app uninstalls. For e.g. Google App Marketing Survey says an average app user has 36 apps installed on his/her smartphone. But they use only one-fourth of these apps daily. The remaining one-fourth that are never used are the ones likely to be uninstalled. Placing few other links in the references section.

app uninstallA Kantar/ITR study showed that an average of 26% of app installs are uninstalled in the first hour. That uninstall rate rises to 38% in the first day, 64% in the first month, and about 89% over 12 months. Those figures represent the average across all app types.
App Marketer’s KPI woes:

If you are a fellow app marketer or a product manager like me, you can feel the pain of a leaky bucket of users uninstalling your app mercilessly. We toil day and night to ensure a sprint app development process, user-friendly app features, and carve the simplest user journeys. We then market it just enough to make our app stay on top of Google Play Store rankings. All seems well and we are right on track to achieve that glorious milestone of 1 million app downloads. But our app analytics tools like Google Analytics, Firebase, Apsalar have a completely different story for us.

The report suggests that app uninstalls are on the rise this month, and your (well, mine too) KPIs for “number of active installs” indicates a churn rate of more than 40%.

What’s the Next Plan of Action?

Armed with the intelligence of the analytics tools, we decode the behavioral attributes of the users/ user segments who have uninstalled your app. The reasons behind most of the uninstall become our next app optimization and development tasks. But we almost forgot about the churned users. How do we win them back?

The first instinct is to take resort in our run-of-the-mill marketing activities.

  1. We run mailer campaigns with offers/marketing gimmicks if they had logged in with their email ids
  2. We send promotional SMS to user inbox if we had managed to capture their phone numbers.

And say, a majority of these users never logged in or gave their personal details to us. Now, as a consequence, we can never retarget them with personalization and the only thing left for us to do is just wait for these users to reinstall our app.

app uninstall

What’s the solution? Do we have a way to stop the users from churning in the first place?

Predictive Action to Stop Users from Churning?

Machine Learning Prediction Model is the answer. At Tatvic, our data science team has come up with a prediction model which feeds in scores of users, devices, and behavior features from the analytics tools and Tatvic’s internal Uninstall Library and predicts the probability of users who will uninstall within the next ‘n ‘ days. We call it PredictN Model.

Here is how it functions - in brief - we input the cohort of users who were acquired between any 15-day period along with their attributes. With previously trained data of identified churned users, PredictN Model will point out unique users from the said cohort who have more than 75% probability of uninstalling within 7 days.

  1. Retarget these users at once via Paid channels and Push notifications
  2. Understand the pattern of these unique users as to why they might be leaving your app from a geographic, demographic, device-specific, and/or behavioral perspective.
How does the model work?

Check this space to know more about model attributes and results in our next blog chapter.

A takeaway for reading till the end - heartfelt thanks, Feel free to reach out to us in case of any query or leave a comment in the section below on how you take predictive actions for uninstalls in your business.

 

Sources:

  1. https://apsalar.com/2016/01/all-about-app-uninstalls-2/
  2. https://www.linkedin.com/pulse/predicting-app-uninstalls-data-little-bit-science-arunachalam
  3. https://techinfographics.com/why-do-people-uninstall-apps/
Bot Icon
Bot Icon

Tatvic Bot

Explore About Tatvic and Services