-
-
Save brunomertins/0f54ce1ec3e4913224dc94933ee0e5f8 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 | |
-- traffic_source.name (dimension | name of the marketing campaign that first acquired the user) | |
traffic_source.name, | |
-- traffic_source.medium (dimension | name of the medium (paid search, organic search, email, etc.) that first acquired the user) | |
traffic_source.medium, | |
-- traffic_source.source (dimension | name of the network that first acquired the user) | |
traffic_source.source | |
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 | |
LIMIT | |
10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment