NOTE: If you're doing anything advanced with your Google Analytics such as e-commerce tracking or have your own events and goals, then this guide will NOT be complete for you. If you're an advanced user, please use the official Google Upgrade Document.

Step 1: Find out your Analytics Tracking Number

It should be of the form UA-XXXXXX-XX. You can use this Google guide for finding your tracking number.

Step 2: Find your old legacy Google Analytics Tracking Code

This code will contain your tracking ID and will similar to this:

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

The key to identifying old legacy analytics versus universal is the JavaScript will contain a file called ga.js (legacy) instead of analytics.js (universal).

This code will be either in a plugin, a hook, your theme settings or directly in your theme file.

Delete your old code!

Step 3: Install your new Universal Analytics!

Get your tracking code from Google Analytics. You can follow this guide to finding your tracking code. It will look similar to this:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-XXXXXX-XX', 'auto');
  ga('send', 'pageview');

</script>

We recommend installing this directly under our script wrapper using the same method you installed that.

Did this answer your question?