Skip to content

Instantly share code, notes, and snippets.

@LucasLarson
Last active October 11, 2020 15:20
Show Gist options
  • Save LucasLarson/0ae0b043095fcb048b835a70a0585fd9 to your computer and use it in GitHub Desktop.
Save LucasLarson/0ae0b043095fcb048b835a70a0585fd9 to your computer and use it in GitHub Desktop.
Google Analytics local `gtag.js` but less unreadable
window.dataLayer = window.dataLayer || []
function gtag () {
window.dataLayer.push(arguments)
}
gtag(
'js',
new Date()
)
gtag(
'config',
'UA-123456-7'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment