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']);
(function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + ''; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();

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:

  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

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


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

Did this answer your question?