Skip to content

Instantly share code, notes, and snippets.

@konosp
Created November 8, 2019 09:54
Show Gist options
  • Select an option

  • Save konosp/c4d0b74d49e0339cd873e81b252aa4d3 to your computer and use it in GitHub Desktop.

Select an option

Save konosp/c4d0b74d49e0339cd873e81b252aa4d3 to your computer and use it in GitHub Desktop.
-- This query is not valid as there is no realtime data available in the sample data set.
SELECT
date,
COUNT(DISTINCT CONCAT(fullVisitorId, CAST(visitStartTime AS STRING))) AS Sessions
FROM
`project.dataset.ga_realtime_view`
WHERE
suffix = CURRENT_DATE()
AND totals.visits = 1
GROUP BY
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment