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. 

Stream & Export your Google Anaytics data to Bigquery Guide

[vc_row][vc_column][vc_column_text]Google Analytics 360 Data BigQuery ExportAs a passionate Google Analytics 360 and BigQuery User, I always want to take quick actions on the current day data within a couple of minutes. And today, I am ecstatic that Google has rolled out a new streaming export feature. Google Analytics 360 users can now export their Google Analytics data in BigQuery within 10 minutes.

This enables you to carry out analysis and take actions six times within one hour using BigQuery which seems almost real-time data export. Aren’t you excited? Let me elaborate on just how awesome this new feature will prove to be!

Power of Unlocking Data Streaming Delivery Feature

All business giants who deal with tons of data points flowing into Google Analytics, require faster data access to identify high intent users, analyse internal promotions and quickly discover anomalies in your critical business metrics. Listed below are the few real-time actions that you can take based on your data:

  • Instant retargeting for higher conversions:
    In today’s fast-paced, dynamic world, every second counts. It is observed from the recent market trends that users are highly likely to convert if they get instant incentives. The sooner they come back to your website, better are the chances of them converting.

    Dynamic and instant remarketing approach will prove to be more promising and effective in driving greater engagements.
  • Real-time Prediction:
    This amazing feature will enable Data Scientist to run predictive algorithms in real-time. With quick download of data, predictions can be tested in a short span of time and new results can be used to retrain for better accuracies. One use case that analysts can make use of, is Predictive Lead Scoring. This will give marketers a score of leads with higher propensity to convert customers within a short span of time. And then automated emailers or push notifications can be sent to the leads where conversion rates can go up due to recency effect. Currently, with the data that is processed, predictions are carried out a day after and chances of conversion become comparatively slimmer.
  • Quick Issue Debugging:
    Frequent data updates in BigQuery will allow organizations to identify issues and help them to fix it quickly.
  • Taking data stitching to the next level:
    Business intelligence tools can also be empowered using raw, hit level, online-behavior data with offline data sources like CRM, call centres and POS data.

4 Easy Steps: Get Started with the all new Data Streaming Feature Now

You can start getting data more frequently by just changing your streaming preference option.

  1. Navigate to your Google Analytics 360 Admin settings
  2. Go to BigQuery Integration Page
  3. Click on Adjust link

You will now see a Streaming Preferences Options. Choose “Data exported continuously” option as shown following:

And voila! You are all set! And that too without any help from your go-to tech guy!

Got questions? Don’t worry, we got you covered!

Once you will opt for this feature, Google Analytics data will start streaming into your BigQuery project as fast as every 10 minutes. Note that this might take few hours to reflect in your BigQuery. As exciting as this is, I am sure this update must have lead to few queries for all of you. I am going to attempt and answer a few FAQs that we’ve experienced from within our team as well as our clients.

  • Is this chargeable? If yes, what is the cost?
    Yes, you will be. The new streaming export uses Google Cloud Streaming Service and that costs a $0.05 per GB. That’s why Google recommends that you choose your own streaming preferences so that you don’t end up with unknown additional cost.
  • Will I see changes in BigQuery?
    Yes, you will start seeing two new tables in your BigQuery cloud platform.
  1. ga_realtime_sessions: In this table, you will get the current day Google Analytics data.
  2. ga_realtime_sessions_view: This is a view - virtual table in BigQuery.

In the detailed section of ga_realtime_sessions_ table, you will also find information regarding the table’s Streaming Buffer if it is present. If there is no data in Streaming Buffer or table is not being streamed to (ga_sessions_intraday_), this section will be absent.

  • What additional data will I see?
    You will able to see updated BigQuery schema under ga_realtime_sessions_view_. Following fields are introduced : 

    1. exportTimeUsec - Unix timestamp when data gets exported to Google Cloud
      For ex. 1505981096384
    2. exportKey - It’s a combination of fullvisitorId, visitStartTime/visitID,
      exportTimeUsec
      Format : fullvisitorId:visitStartTime/visitID: exportTimeUsec
      For ex. 3601279501650676672:1505976859:1505981096384
    3. visitKey -  It’s a combination of fullvisitorId and visitStartTime/visitID
            For ex. 3601279501650676672:1505976859

If you don’t opt for the data streaming feature, then you will continue to see data streaming like you do today, which is about thrice a day i.e. every eight hours.

Concluding Thoughts:

All that which is captured through analytics tracking is included in this streaming export. Although be aware, data sources like AdWords and DoubleClick, Search console will be not included in same.

Happy data streaming!

What do you think about this new data streaming feature introduced by Google? I would love to hear your views and take on it. Please do write to me in the comments section below, I am looking forward to it. 

We at Tatvic also provide BigQuery Training for Corporates & Developers.[/vc_column_text][/vc_column][/vc_row]

Bot Icon
Bot Icon

Tatvic Bot

Explore About Tatvic and Services