Created
April 22, 2020 15:38
-
-
Save josiehall/af546b3f95659b28eaf403ccfc1f44e4 to your computer and use it in GitHub Desktop.
SQL query which shows how long users typically spend on your site, and how that has trended over time.
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
select | |
date(session_start_timestamp) as date, | |
avg(stats.duration_millis) as mean_session_duration_millis, | |
approx_quantiles(stats.duration_millis, 101)[safe_offset(25)] as percentile_25, | |
approx_quantiles(stats.duration_millis, 101)[safe_offset(50)] as percentile_50, | |
approx_quantiles(stats.duration_millis, 101)[safe_offset(75)] as percentile_75 | |
from | |
dataform_data_sources.segment_sessions | |
group by | |
date | |
order by | |
date desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment