Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase -> BigQuery how to get active users for that month, week, day

I have absolutely no idea where to start on this, I've already searched google for information and came up with nothing. I have many apps from Firebase feeding into BigQuery. I want to be able to get the active users for that month from bigquery. There has got to be a way that you can simply do this. Any help would be great. Thanks.

like image 907
Joe Scotto Avatar asked Jan 05 '17 18:01

Joe Scotto


People also ask

How does firebase define active users?

An active user has engaged with an app in the device foreground, and has logged a user_engagement event.

What is the monthly active user average for each app that you use with Firebase ?*?

Firebase Dashboard: 28-day Active users: 8661. 7-day Active users: 3874. 1-day Active users: 1111.

What is user activity over time?

User activity over time – this metric shows the number of active users of your website for 1 day, 7 days and 30 days. User stickiness – indicates the ratio of users over 30 days that are active on a predefined time period. It includes: Daily active users(DAU) and Monthly active users(MAU) ratio.


1 Answers

It should be possible to count the number of distinct fullVisitorId, grouped by month:

#standardSQL
SELECT
  EXTRACT(MONTH FROM
      TIMESTAMP_MICROS(user_dim.first_open_timestamp_micros)) AS month,
  COUNT(DISTINCT user_dim.app_info.app_instance_id) AS monthly_visitors
FROM `your_dataset.your_table`
GROUP BY month;

(Note that this groups January of this year with January of last year, however). You could alternatively group by year + month:

#standardSQL
SELECT
  FORMAT_TIMESTAMP(
      '%Y-%m',
      TIMESTAMP_MICROS(user_dim.first_open_timestamp_micros)) AS year_and_month,
  COUNT(DISTINCT user_dim.app_info.app_instance_id) AS monthly_visitors
FROM `your_dataset.ga_sessions`
GROUP BY year_and_month;
like image 69
Elliott Brossard Avatar answered Oct 23 '22 23:10

Elliott Brossard