Created
November 8, 2019 09:54
-
-
Save konosp/0af9f6d7ae276f143e135998b9966011 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| -- This query will return no intraday data as there is no intraday data available in the sample data set. | |
| SELECT | |
| _table_suffix AS Table_Suffix, | |
| COUNT(DISTINCT CONCAT(fullVisitorId, CAST(visitStartTime AS STRING))) AS Sessions | |
| FROM | |
| `bigquery-public-data.google_analytics_sample.ga_sessions_*` | |
| WHERE | |
| REGEXP_EXTRACT(_table_suffix, r'[0-9]+') BETWEEN '20160801' | |
| AND FORMAT_DATE('%Y%m%d', CURRENT_DATE()) | |
| AND totals.visits = 1 | |
| GROUP BY | |
| 1 | |
| ORDER BY | |
| 1 DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment