Skip to content

Instantly share code, notes, and snippets.

@lacerogers20
Last active August 26, 2022 09:39
Show Gist options
  • Save lacerogers20/3744d88031b539317a1815da3c7cfc10 to your computer and use it in GitHub Desktop.
Save lacerogers20/3744d88031b539317a1815da3c7cfc10 to your computer and use it in GitHub Desktop.
SELECT
date,
COUNT(DISTINCT(visitid)) as unique_visits
FROM `bigquery-public-data.google_analytics_sample.ga_sessions_*`
WHERE _table_suffix = '20170801' # use date_sub to programmatically select your table
GROUP BY date
ORDER BY date
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment