<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Andre Wiramihardja on Medium]]></title>
        <description><![CDATA[Stories by Andre Wiramihardja on Medium]]></description>
        <link>https://medium.com/@andrewiramihardja?source=rss-b2a6c7beae0a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4O5JA0BCwA51Gy0_YU39sA.jpeg</url>
            <title>Stories by Andre Wiramihardja on Medium</title>
            <link>https://medium.com/@andrewiramihardja?source=rss-b2a6c7beae0a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 21:56:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@andrewiramihardja/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Maximize Your Mobile Application Analytics using Firebase]]></title>
            <link>https://medium.com/bliblidotcom-techblog/maximize-your-mobile-application-analytics-using-firebase-f573a2c63ac9?source=rss-b2a6c7beae0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f573a2c63ac9</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[mobile-app-analytics]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Andre Wiramihardja]]></dc:creator>
            <pubDate>Wed, 17 May 2023 02:41:38 GMT</pubDate>
            <atom:updated>2023-05-19T08:38:09.908Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7xqFACaGhcljAHyI" /><figcaption>Photo by <a href="https://unsplash.com/@balazsketyi?utm_source=medium&amp;utm_medium=referral">Balázs Kétyi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you are working with mobile applications, chances are you know one or two things about <a href="https://firebase.google.com/">Firebase</a>. For those of you who are not yet familiar with Firebase, it is essentially a collection of services that are mainly used in app development. I recommend reading this great article by Doug Stevenson:</p><p><a href="https://medium.com/firebase-developers/what-is-firebase-the-complete-story-abridged-bcc730c5f2c0">What is Firebase? The complete story, abridged.</a></p><p>Like any other Google products, Firebase has seamless integration with many other Google products such as Google Analytics, Google Ads, and BigQuery.</p><p>I am (well, <em>was</em>) a Data Analyst for a mobile application, and almost 100% of the data I work on a day-to-day basis comes from Firebase. When I first worked with the product, we only utilized 2 Firebase products for analytics. But now, after realizing how <em>powerful</em> Firebase is for mobile app analytics, we have been using data from 4 Firebase products in our analytics tech stack, with more to come.</p><p>Without further ado, let’s see what the products are!</p><h3>Firebase Analytics</h3><h4>What is Firebase Analytics?</h4><p>At the heart of Firebase is Firebase Analytics. Those of you who have used Google Analytics 4 might already know that Firebase Analytics uses the same event-based schema, where each event in-app is recorded as one row of data along with its many customizable parameters.</p><p>If you’re not familiar with event-based data and how to work with them, I suggest you read this article by Todd Kerpelman:</p><p><a href="https://medium.com/firebase-developers/using-the-unnest-function-in-bigquery-to-analyze-event-parameters-in-analytics-fb828f890b42">Using the UNNEST function in BigQuery to analyze event parameters in Analytics</a></p><p>You don’t need any additional setups on Firebase to use this feature, as Firebase will collect the data automatically for you. These includes common metrics such as DAU/MAU to more specific metrics such as Engagement Time and User Retention.</p><p>Similar to Google Analytics, you can implement custom event tracking using Firebase Analytics to track a specific part/feature of your app.</p><h4>How I use Firebase Analytics data as a Data Analyst</h4><p><strong>Use Case 1. Breakdown number of users by device and OS version </strong>— Firebase has already provided this data on the console. However, they use the device model name, instead of the more common marketing name — think <em>Xiaomi Redmi Note 10S </em>instead of <em>M2003J158C</em>. Using BigQuery, you can access the device.mobile_marketing_name field. FYI, the data on Firebase console use device.mobile_model_name instead.</p><p>This simple query is all you need to run</p><pre>SELECT<br>  PARSE_DATE(&#39;%Y%m%d&#39;,event_date) AS event_date,<br>  CONCAT(<br>    device.mobile_brand,<br>    &#39; &#39;,<br>    COALESCE(device.mobile_marketing_name, device.mobile_model_name)<br>  ) AS device,<br>  COUNT(DISTINCT user_pseudo_id) AS total_user,<br><br>FROM `firebase-project.analytics_123456789.events_*`<br><br>GROUP BY 1,2</pre><p><strong>Use Case 2. Implement custom event tracking for specific features </strong>—PMs will usually want to know how their newly-deployed feature fares against the users. A common method to gauge a new feature’s performance is to measure how many users are using it. Also, depending on the type of app your team is developing, you can also create a user journey funnel.</p><p>An interesting use case for custom event tracking using Firebase Analytics is to track whenever a user encounters an error page or basically whatever UI component (pop-up dialogs, toasters, etc.) the error is shown in. Why is this important you ask? Well, who wants to use an app that is constantly showing you “<strong><em>Sorry, an unexpected error happened</em></strong>” pages again and again?</p><p>Suppose that we have two important pages — Dashboard and Account Page, in which we want to track the errors. We might implement a custom event with the following specification:</p><ul><li>Event name is error_show</li><li>Parameter error_page whose value contains the current page</li><li>Parameter error_code whose value contains the error code</li></ul><p>Using these 2 simple parameters is enough for us to run this query</p><pre>SELECT<br>  PARSE_DATE(&#39;%Y%m%d&#39;,event_date) AS event_date,<br>  ep.value.string_value AS error_page,<br>  ec.value.string_value AS error_code,<br>  COUNT(*) AS total_occurences,<br>  COUNT(DISTINCT user_pseudo_id) AS total_users,<br><br>FROM `firebase-project.analytics_123456789.events_*`<br>CROSS JOIN UNNEST(event_params) ep ON key = &#39;error_page&#39;<br>CROSS JOIN UNNEST(event_params) ec ON key = &#39;error_code&#39;<br><br>WHERE event_name = &#39;error_show&#39;</pre><p>Or you can take it further and query this instead</p><pre>WITH<br>error_session AS (<br>  SELECT<br>    PARSE_DATE(&#39;%Y%m%d&#39;,event_date) AS event_date,<br>    CONCAT(s.value.int_value,user_pseudo_id) AS session_id,<br>    ep.value.string_value AS error_page<br><br>  FROM `firebase-project.analytics_123456789.events_*`<br>  CROSS JOIN UNNEST(event_params) s ON key = &#39;ga_session_id&#39;<br>  CROSS JOIN UNNEST(event_params) ep ON key = &#39;error_page&#39;<br>  <br>  WHERE event_name = &#39;error_show&#39;<br>),<br>all_session AS (<br>  SELECT<br>    PARSE_DATE(&#39;%Y%m%d&#39;,event_date) AS event_date,<br>    CONCAT(s.value.int_value,user_pseudo_id) AS session_id,<br>    fsc.value.string_value AS page_name<br><br>  FROM `firebase-project.analytics_123456789.events_*`<br>  CROSS JOIN UNNEST(event_params) s ON key = &#39;ga_session_id&#39;<br>  CROSS JOIN UNNEST(event_params) fsc ON key = &#39;firebase_screen_class&#39;<br>  <br>  WHERE event_name = &#39;screen_view&#39;<br>)<br>SELECT<br>  a.event_date,<br>  a.page_name,<br>  SAFE_DIVIDE(<br>    COUNT(DISTINCT e.session_id),<br>    COUNT(DISTINCT a.session_id)<br>  ) AS dirty_session<br>  <br>FROM all_session a<br>LEFT JOIN error_session e<br>  ON a.event_date = e.event_date<br>  AND a.page_name = e.error_page<br>  AND a.session_id = e.session_id</pre><p>In the above query, we use one of the many <a href="https://support.google.com/analytics/answer/9234069?hl=en">automatically collected events</a> by Firebase Analytics, which is the screen_view event, to calculate <em>dirty session </em>which is the percentage of sessions of a specific page that contains at least one error occurrence. A little caveat here, is that you have to make sure that the value tracked on error_page parameter have to be the same as the value on firebase_screen_class parameter.</p><h3>Firebase Cloud Messaging</h3><h4>What is Firebase Cloud Messaging?</h4><p>Firebase Cloud Messaging (FCM) is mainly used to send notifications to the user’s app across platforms. Often, push notifications are sent to users with one of two goals in mind: <em>information </em>and <em>engagement</em>. In case of <em>information</em>, we want to make sure that the push notification is delivered and that the users have seen them. In case of <em>engagement</em>, we want them to act on the push notification after they received it.</p><h4>How I use FCM data as a Data Analyst</h4><p><strong>Use Case 1. Track push notification funnel </strong>— FCM handles the sending of the notification, but it doesn’t guarantee that it will be delivered successfully to the recipient’s device (due to many factors such as inactive device, etc.). The low delivery rate might indicate that most of the targeted devices are inactive which means redundant effort.</p><p>We also might want to know the CTR (click-through rate) of varying types of push notifications. The same push notification worded differently might just be a more effective lead generator, resulting in more users clicking the push notification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jPcqcpx_KAykfszi0zO7ag.png" /><figcaption>You can make a <strong>Simple Funnel</strong>, or if you’re up for it go for the <strong><em>Advanced Funnel</em></strong></figcaption></figure><p>Let’s say that we’re building an e-commerce app, and we want to send a push notification to a predefined customer segment, that a Black Friday campaign is ongoing and they’re getting a discount coupon that they can use on their next purchase.</p><p>A <strong>Simple Funnel </strong>might be able to answer this question :</p><blockquote>How many of our targeted push notifications are actually delivered to the users?</blockquote><p>We can compute the delivery rate of our push notification using this query</p><pre>WITH<br>sent AS (<br>  SELECT<br>    DATE(event_timestamp) AS event_date,<br>    COUNT(DISTINCT CONCAT(message_id,instance_id)) AS total_sent<br>  <br>  FROM `firebase-project.firebase_messaging.data`<br><br>  WHERE<br>    /* Filter for sent messages only */<br>    event = &#39;MESSAGE_ACCEPTED&#39;<br>    /* Filter for the associated push notification only */<br>    AND analytics_label = &#39;BLACK_FRIDAY&#39;<br>  <br>  GROUP BY 1<br>),<br>delivered AS (<br>  SELECT<br>    DATE(event_timestamp) AS event_date,<br>    COUNT(DISTINCT CONCAT(message_id,instance_id)) AS total_delivered<br>  <br>  FROM `firebase-project.firebase_messaging.data`<br>  <br>  WHERE<br>    /* Filter for delivered messages only */<br>    event = &#39;MESSAGE_DELIVERED&#39;<br>    /* Filter for the associated push notification only */<br>    AND analytics_label = &#39;BLACK_FRIDAY&#39;<br>  <br>  GROUP BY 1<br>)<br>SELECT<br>  event_date,<br>  total_sent,<br>  total_delivered,<br>  total_delivered / total_sent AS delivery_rate<br>  <br>FROM sent<br>FULL JOIN delivered<br>  USING(event_date)</pre><p>You might notice that I’ve added a filter using the analytics_label field, which contains a custom value that we can add when we are sending the request to FCM API. More details about adding analytics label to your messages can be read <a href="https://firebase.google.com/docs/cloud-messaging/understand-delivery?platform=ios#adding-analytics-labels-to-messages">here</a>.</p><p>The Simple Funnel works fine, until the marketing team comes and asked us this question :</p><blockquote>Is the push notification effective enough? How many users actually made a purchase because of the push notification?</blockquote><p>This is a tricky question. We can never be sure that someone made a purchase <em>because </em>of the push notification. We can, however just make an assumption that if they use the discount coupon and is on the predefined customer segment group, then they made the purchase already aware of the push notification.</p><p>To answer the question above, we will create the <strong>Advanced Funnel</strong>. For the Advanced Funnel, we added 2 more funnel steps —<em> Clicked </em>and <em>Converted</em>. In the above case, <em>Converted </em>means the user have purchased a product using the discount coupon mentioned in the push notification.</p><p>However, FCM data only identifies a push notification up until the <em>Delivered </em>step. Luckily, we have our friend Firebase Analytics! Again we will use one of the <a href="https://support.google.com/analytics/answer/9234069?hl=en">automatically collected events </a>which is the notification_open event, that we can use for our <em>Clicked </em>step.</p><p>For the <em>Converted </em>step, we will utilize a table taken from our transaction database that is already available on our BigQuery.</p><p>We can run another query to add the two funnel steps</p><pre>WITH<br>sent AS (<br>  SELECT<br>    DATE(event_timestamp) AS event_date,<br>    COUNT(DISTINCT CONCAT(message_id,instance_id)) AS total_sent<br>  <br>  FROM `firebase-project.firebase_messaging.data`<br><br>  WHERE<br>    /* Filter for sent messages only */<br>    event = &#39;MESSAGE_ACCEPTED&#39;<br>    /* Filter for the associated push notification only */<br>    AND analytics_label = &#39;BLACK_FRIDAY&#39;<br>  <br>  GROUP BY 1<br>),<br>delivered AS (<br>  SELECT<br>    DATE(event_timestamp) AS event_date,<br>    COUNT(DISTINCT CONCAT(message_id,instance_id)) AS total_delivered<br>  <br>  FROM `firebase-project.firebase_messaging.data`<br>  <br>  WHERE<br>    /* Filter for delivered messages only */<br>    event = &#39;MESSAGE_DELIVERED&#39;<br>    /* Filter for the associated push notification only */<br>    AND analytics_label = &#39;BLACK_FRIDAY&#39;<br>  <br>  GROUP BY 1<br>)<br>clicked AS (<br>  SELECT<br>    PARSE_DATE(&#39;%Y%m%d&#39;,event_date) AS event_date,<br>    COUNT(*) AS total_clicked<br>  <br>  FROM `firebase-project.analytics_123456789.events_*`<br>  CROSS JOIN UNNEST(event_params) p ON key = &#39;label&#39;<br>  <br>  WHERE<br>    /* Filter for the notification_open event */<br>    event_name = &#39;notification_open&#39;<br>    /* Filter for the associated push notification only */<br>    p.value.string_value = &#39;BLACK_FRIDAY&#39;<br><br>  GROUP BY 1<br>),<br>converted AS (<br>  SELECT<br>    t.trx_date AS event_date,<br>    COUNT(DISTINCT t.trx_id) AS total_converted<br><br>  FROM `your-project.transaction.transaction_detail` AS t<br>  LEFT JOIN `your-project.customer.customer_detail` AS c<br>    USING(customer_id)<br>  <br>  WHERE<br>    /* Filter for the coupon code associated with the campaign only */<br>    t.discount_coupon_code = &#39;BLKFRDY&#39;<br>    /* Filter for customer in the predefined segment only */<br>    AND c.customer_segment = &#39;Predefined Segment - Black Friday&#39;<br>)<br><br>SELECT<br>  event_date,<br>  total_sent,<br>  total_delivered,<br>  total_clicked,<br>  total_converted,<br>  total_delivered / total_sent AS delivery_rate,<br>  total_clicked / total_delivered AS click_through_rate,<br>  total_converted / total_clicked AS conversion_rate<br>  <br>FROM sent<br>FULL JOIN delivered<br>  USING(event_date)<br>FULL JOIN clicked<br>  USING(event_date)<br>FULL JOIN convereted<br>  USING(even_date)</pre><p>The converted subquery part in the above query might be different in your case, but you got the point.</p><p><strong>Use Case 2. Measure latency in push notification delivery </strong>— In some cases, we might want to deliver information to the users in an instant. I’ve heard many users complaining that they don’t receive any push notification when they receive an in-app message. Turns out it is delayed by several minutes. Measuring time to deliver push notification might help to identify potential problems.</p><p>We can use this query to measure overall latency in delivery time for each type of push notification.</p><pre>WITH<br>sent AS (<br>  SELECT<br>    message_id,<br>    instance_id,<br>    analytics_label,<br>    event_timestamp AS sent_timestamp<br><br>  FROM `firebase-project.firebase_messaging.data`<br>  <br>  WHERE event = &#39;MESSAGE_ACCEPTED&#39;<br>),<br>delivered AS (<br>  SELECT<br>    message_id,<br>    instance_id,<br>    analytics_label,<br>    event_timestamp AS delivered_timestamp<br><br>  FROM `firebase-project.firebase_messaging.data`<br>  <br>  WHERE event = &#39;MESSAGE_DELIVERED&#39;<br>)<br>SELECT<br>  analytics_label,<br>  AVG(<br>    TIMESTAMP_DIFF(delivered_timestamp,sent_timestamp,MILLISECOND)<br>  ) AS avg_latency_in_ms<br><br>FROM sent<br>FULL JOIN delivered<br>  USING(message_id,instance_id)<br><br>GROUP BY 1</pre><p>So, that’s it folks!</p><p>But wait… you said it was 4 products, but you only shown 2 products! Well, find out in my next post!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f573a2c63ac9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/bliblidotcom-techblog/maximize-your-mobile-application-analytics-using-firebase-f573a2c63ac9">Maximize Your Mobile Application Analytics using Firebase</a> was originally published in <a href="https://medium.com/bliblidotcom-techblog">Blibli.com Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>