-
-
Save cgi-ace/0b6962fc49464763bf0b41faf3f1609e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Avg Session Interval Across Daysuseful for Apps like Food Delivery Apps. | |
-- Step 1 is to find the minimum of event time for engament event for ever user; as a sample lets try for Australia. Although there can be many engagement event for a user | |
-- in a day, we are intrested in only earliest engagement event | |
SELECT | |
user_pseudo_id, | |
event_date, | |
min(TIMESTAMP_MICROS(event_timestamp)) as session_start, | |
geo.country as country, | |
device.operating_system as OS | |
FROM `firebase-public-project.analytics_153293282.events_*` | |
where event_name = 'user_engagement' | |
and _TABLE_SUFFIX between '20180601'and '20181031' | |
and geo.country = 'Australia' | |
group by user_pseudo_id,event_date,country,OS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment