DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Google Analytics Tracking Code

06.09.2008
| 1755 views |
  • submit to reddit
        

      <script type="text/javascript">
      var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
      document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
      </script>

      <script type="text/javascript">
      var pageTracker = _gat._getTracker("UA-xxxxxx-x");
      pageTracker._initData();
      pageTracker._trackPageview();
      </script>