Last active
February 8, 2026 12:29
-
-
Save vanaf1979/3bff2b953671c15c9417c6d676dedfd2 to your computer and use it in GitHub Desktop.
Google analytics 4 tracking snippet for tutorial: https://since1979.dev/custom-google-analytics-events-with-javascript/
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
| <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script> | |
| <script> | |
| window.dataLayer = window.dataLayer || []; | |
| function gtag(){dataLayer.push(arguments);} | |
| gtag('js', new Date()); | |
| gtag('config', 'G-XXXXXXXXXX'); | |
| </script> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment