Created
April 5, 2013 11:21
-
-
Save padicode/5318565 to your computer and use it in GitHub Desktop.
Google Analytics Universal Tracking Init in Google Tag Manager
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> | |
(function(q,u,i,c,k){window['GoogleAnalyticsObject']=q; | |
window[q]=window[q]||function(){(window[q].q=window[q].q||[]).push(arguments)}, | |
window[q].l=1*new Date();c=i.createElement(u),k=i.getElementsByTagName(u)[0]; | |
c.async=true;c.src='//www.google-analytics.com/analytics.js'; | |
k.parentNode.insertBefore(c,k)})('ga','script',document); | |
ga('create', 'UA-XXXXXXXX-XX', 'yourwebsite.com'); //make sure to customize your tracking ID and your domainname | |
dataLayer.push({"event":"trackingLoaded"}); //don't forget to add this line | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment