Google Analytics Code

Google Analytics (GA) has evolved over the years to make it better, faster and more accurate. But only if you keep it updated...

     In November 2005 Google Analytics launched after Google acquired URCHIN SOFTWARE earlier that year.
     In December 2007 Google introduced their TRADITIONAL/SYNCHRONOUS version.
     In December 2009 the ASYNCHRONOUS version was released. Its JavaScript runs parallel to others in a website. In addition
      to minimizing drag on page load speed, it moved higher up within a website's code - allowing for more accurate data collection.
     In April 2014 the UNIVERSAL version came out of beta. This latest version uses a single cookie to (potentially) track users
      across multiple devices and is highly customizable.

Unless your IT team has updated your Google Analytics along the way, you may not be accurately tracking your website traffic. The following provides location and appearance of each of the iterations of Google Analytics Code. Pass it along to your team to confirm your GA is truly up to date!

2005 - Urchin

The code goes before closing body tag </BODY>

<script src=“” type=“text/javascript”></script>
<script type=“text/javascript”>
_uacct = “UA-#####-#”;

2007 - Traditional/Synchronous

The code goes before closing body tag </BODY>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "href="https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + " type='text/javascript'%3E%3C/script%3E"));
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-######-#");
} catch(err) {}</script>

2009 - Asynchronous

The code goes before closing head tag </HEAD>

<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-########-#']);
function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'href="https://ssl' : 'http://www') + '';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

2014 - Universal

The code goes before closing head tag </HEAD>

(i[r].q=i[r].q||[]).push(arguments)},i[r].|=1*new Date();a=s.createElement(o),
ga('create', 'UA-########-#', '');
ga('send', 'pageview');

Google URL Tags

In addition to traffic data, Google Analytics provides a way to measure inbound visitors from your advertising expenditures and marketing partners. Add Google URL Tags to incoming links to generate far more accurate data in Campaigns than what you find in Referrals. See details of setting up and tracking Google URL Tags here.