-
-
Save brunomertins/2ae820e70dbd8c22f37fd741a07aea53 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
SELECT | |
-- geo.continent (dimension | the continent from which events were reported, based on IP address) | |
geo.continent, | |
-- geo.sub_continent (dimension | the subcontinent from which events were reported, based on IP address) | |
geo.sub_continent, | |
-- geo.country (dimension | the country from which events were reported, based on IP address) | |
geo.country, | |
-- geo.region (dimension | the region from which events were reported, based on IP address) | |
geo.region, | |
-- geo.city (dimension | the city from which events were reported, based on IP address) | |
geo.city, | |
-- geo.metro (dimension | the metro from which events were reported, based on IP address) | |
geo.metro | |
FROM | |
-- Change this to your Google Analytics 4 export location in BigQuery | |
`ga4.analytics_1234567890.events_*` | |
WHERE | |
-- Define static and/or dynamic start and end date | |
_table_suffix BETWEEN '20200220' | |
AND FORMAT_DATE('%Y%m%d',DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY)) | |
GROUP BY | |
1, | |
2, | |
3, | |
4, | |
5, | |
6 | |
LIMIT | |
10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment