Universal Analytics implementation

| 02 Sep, 2014

As most of our readers are aware, Universal Analytics is no longer in BETA and has been working as the Google Analytics official version since the announcement in April.

You've probably heard about the new version and all the features it brings, but how is it affecting you if you're currently using the previous version of Google Analytics (also known as Standard or Asynchronous)? Following on from our previous blog post about the release of Universal Analytics (UA), this post takes a look at the main differences between both versions and how to implement/migrate your account to UA.

Tracking code

You need to upgrade your account to UA through the interface. This option in the Admin menu.


This is the first step of the migration. As soon as you complete the process, the property will be transferred to Universal Analytics. This can take up to 48 hours (but usually more like 24 hours).

If you have successfully transferred the account you will be able to find the options below in the Admin section.


At this point, the account has been migrated to UA and 's ready to receive information using the new ‘language’, but you can still use the previous code for two years. It won’t be valid after that.

In the menu shown in the previous screenshot, you can find the structure of the tracking code under the section “Tracking Code”. As you may appreciate based on the following screenshot, it’s very similar to the previous version:



The account ID (UA-XXXX-Y) will be automatically generated. You then need to copy and paste this code into all pages of the site. The code has to be placed just before the closing head tag, as done in the previous version.

Cross-domain Tracking

You can measure multiple domains within the same Google Analytics account to track the complete user journey, but you will need to adjust the code to measure it properly. If you don’t do this, information about campaigns and traffic sources may be lost. This occurs when the user crosses between both websites, as Google Analytics creates a new user and session and therefore won’t be able to track the user on both sites at the same time.

The correct measurement of multiple domains in Google Analytics includes additional code, such as the following:



The method ‘allowLinker’ will enable sharing of the user ID value through a link that points to a different domain but is still part of the user journey.

This would be the code for your first domain, so don’t forget to replace the tracking ID (UA-XXXX-Y) and the domain site2.com with the domain the site points to. The code that has to be included on the second domain follows the same structure:


Subdomain tracking

Tracking multiple subdomains with Google Analytics requires adding one line of code to the Google Analytics tracking code. By doing this, you will correctly track any subdomain.

How do you update your tracking code in UA to track subdomains? You don’t have to change the tracking code because Google has implemented UA tracking code to track all subdomains automatically.

Event tracking

Event tracking is very useful to measure how the users interact with the content on your website, such as in-page elements (clicks, impressions, etc.). You can track events with UA using the following code:


You can use these three fields, ‘Category’, ‘Action’ and ‘Label’ to send information to Google Analytics with regards to the interaction of the user. These values can be defined as follows:

  • Category – A name that classifies the object that was interacted with (e.g. button, banner)
  • Action – The type of interaction (e.g. click)
  • Label – A deeper description of the element interacted (e.g. home banner)

Custom dimensions

Custom dimensions provide additional segments when tracking the user activity within a site.

Custom dimensions have to be enabled within the Google Analytics interface before implementing the code. Otherwise data will not be captured. This option is under the custom definitions menu.



Now you only have to set the name and scope of the custom dimensions you are creating. The scope determines the expiration of the values stored in the custom dimensions. There are three different scopes:

  1. Hit – The value will be tied to the hit and expires straight away (e.g. article type)
  2. Session – The value is set for the whole session and expires after (e.g. logged in vs. not logged in)
  3. User – The value is set for the current and future sessions, as it will be tied to the user unless the dimension is set with a new value (e.g. customer vs. lead)

This configuration allows receiving and reporting data for this custom dimension. The tracking code is as follows:



‘Dimension[0-20]’ is the index and the field ‘Values’ stores the information you need.

By default there are twenty custom dimensions available in Google Analytics. If you are using Google Analytics Premium this number increases up to 200.


Ecommerce is a module of Google Analytics that allows an in-depth reporting of transactions that happen on your website.

The first thing to do in order to have Ecommerce reports is enabling the ecommerce tracking in the profile settings of your Google Analytics account. Ecommerce tracking code has to be installed within the code confirmation page. On Universal Analytics, the code has been optimised and the structure is as follows:

Please enter a valid Name.
Please enter a valid email address.
Please enter a valid Phone.
Please enter a valid Company Name.
  • Select Service
  • Analytics
  • Brand
  • Consultancy
  • Conversion Rate Optimization
  • Display
  • DoubleClick Partnership
  • Email
  • PPC
  • SEO
  • Social
  • UX
  • Video
  • Websites
  • All Services
By providing your email address you are allowing Jellyfish to send you email communications in accordance with our Privacy Policy and Terms and Conditions