Posted By

peterbelsky on 01/23/10


Tagged

javascript google Analytics


Versions (?)

Google Analytics Javascript


 / Published in: JavaScript
 

async loading

  1. <script type="text/javascript">
  2. var _gaq = _gaq || [];
  3. _gaq.push(['_setAccount', 'UA-#######-#']); //your code here
  4. _gaq.push(['_trackPageview']);
  5. </script>
  6. <script type="text/javascript">
  7. (function() {
  8. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  9. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  10. (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
  11. })();
  12. </script>

Report this snippet  

You need to login to post a comment.