Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Load Google Analytics from external file
window.addEventListener('load', function () {
ga('create', 'UA-XXXXXXXX-1', 'auto')
ga('send', 'pageview')
})
<script type="text/javascript" src="https://ssl.google-analytics.com/analytics.js" async id="ga"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.