Last active
December 20, 2018 15:38
-
-
Save kostasx/267b5202d6f37d2342c17443beb7eb01 to your computer and use it in GitHub Desktop.
Google Analytics JavaScript async Snippet to paste on the GA input field
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
(function(){ | |
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; | |
ga('create', 'UA-XXXXX-Y', 'auto'); | |
ga('send', 'pageview'); | |
var s = document.createElement('script'); | |
s.setAttribute('async', true); | |
s.setAttribute('src', 'https://www.google-analytics.com/analytics.js'); | |
var $head = document.getElementsByTagName('head'); | |
$head[0] && $head[0].appendChild(s); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment