Aug 13, 2014

How to Test Universal Analytics Before Upgrading: via Google Tag Manager


Test Universal Analytics with Google Tag Manager

Since Universal Analytics came out of beta last April, more and more users have been starting the upgrade process from classic Google Analytics. Altough Google strongly encourages to do the upgrade, and reassure that the migration will not cause any loss of data (perhaps just a few seconds of traffic), some of us still remain a bit worried about the change. This is especially true in the case of big websites with a large number of tags already implemented through classic Google Analytics.

Will there be any significant difference in data after the complete migration? Will Universal Analytics inflate/reduce some metrics compared to classing tracking code? These questions should motivate you to perform some testing before moving completely to a new standard.

In this post I am going to suggest a step by step process to conduct your upgrade to Universal Analytics, with the help of Google Tag Manager. Yes, this post is also about Google Tag Manager. It´s actually about taking the opportunity of the transition to a new standard (Universal Analytics) and make it in the most efficient and safest way (Google Tag Manager).

The main idea of this step by step process is to keep the upgrade "under control" and make sure you are going to get the same quality of data as before.

To do so, you will implement Universal tracking code through Google Tag Manager, into a new "test" property. On this new property you will replicate and test the current tags configuration. You will then compare new data with classic Google Analytics tracking data and evaluate possible discrepancies. Yes, this means having old hard-coded tags cohexisting with new ones served through Google Tag Manager. At least for some time: the time necessary to confirm that everything is working properly. That's the aim of the test.

Once you are happy with the results (Universal Analytics data look right!), you will finally upgrade your "old" Google Analytics property to Universal Analytics. Via Google Tag Manager, obviously.

Explaining this quickly, the upgrading process can sounds a bit confusing. That's why I've decided to write step by step instructions. You can go straight to the 10 steps upgrading process below if you prefer, though I thought that first you might want me to remind you WHY YOU ARE DOING THIS UPGRADE.

Which are the benefits of upgrading to Universal Analytics? And which the advantages of using a tagging platform such Google Tag Manager?? Here below is a short reminder to convince you further that the upgrade is the right thing to do.


Why would you upgrade to Universal Analytics?


Universal Analytics is the new version of Google Analytics tracking code. It has 100% feature compatibility with classic Google Analytics (everything you do in GA, you can do it with UA), but it also offers several improvements with respect to data processing, data collection as well as to the way these data can be analysed.

As most of you already know, all "classic" Google Analytics properties are required to upgrade in the future, since Universal Analytics will become the operating standard for Google Analytics. You can find here more details about the Universal Analytics Upgrade Timeline (currently we are in phase 3).

So, which are these improvements  made by Universal Analytics? According to Google evelopers, here are the main benefits you will get once you complete upgrade to Universal:
  1. Cross device measurement. thanks to a new User-ID feature, Univeral Analytics will allow you to understand how users interact with your website across multiple devices like desktop, tablet, mobile or any other digital device. That is analysing the user during his entire journey. To get this benefit working, you will probably need a developer to set it up and assign unique IDs to users. 
  2. Create customized metrics and dimensions. if you need to measure something very specific to your business, which is not contemplated in current Google Analytics settting or metrics, now you can do it with Universal. For example, you might want to track product details or levels in games if you are a videogame company, etc. 
  3. Track any digital device. Universal Analytics introduces 3 new developer-friendly data collection methods so that you can customize your analytics implementation. These are the analytics.js JavaScript library for websites, the Mobile SDKs v.2.x for Android and IOS, and the Measurement Protocol for other digital devices such as game consoles or information kiosks.
  4. Configure account options more easily. From the Admin section of your account, you can now adjust settings such as sessions time out (by default are 30min), manage the list of recognized search engines (categorize some of them as referrals instead of organic), exclude specific domains from being recognized as referrals (e.g. traffic from a third-party shopping cart links in a cross-domain tracking), or exclude traffic coming to your site using specific keywords (you might want to exclude you own business name or domain being counted as search traffic, and make it appear within direct traffic channel from now on).
  5. Enhanced Ecommerce reports. These new reports will be available once upgraded to Universal Analytics, and they will let you understand more effectively your user shopping and purchasing behavoiur. A good place to start playing with these reports, is attending the Ecommerce Analytics course from Analytics Accademy.  
  6. Future features update. All new features and product upddates, from now on will only be available to Universal Analytics properties (that is receiving data from Universal Analytics tracking code). In simple words, if you wanna stay up to date to latest innovations in Google Analytics, upgrade to Universal soon!


Why should you also implement Google Tag Manager?


Google Tag Manager is a free tool that lets you implement and manage all your website (or mobile app) tags in one place. This means you don´t need anymore to manually add JavaScript tags to the source code of your site.

How can be that possible? Simple, Google Tag Manager works via a single tag called "container snippet" that you place on all your web pages. Once the container is installed, you will be able to add, update and administer tags directly from your Google Tag Manager, so without touching the site code.

If you had the chance to work with large/complex websites, you can quickly realize what that means in terms of tags implementation: tedious code-editing activities, dependence from your IT department, etc.. Switching to a tag management solution is a really big step forward for your web analytics projects. Here below is a list of the main benefits of using a tag solution like Google Tag Manager, as reported by Lunametrics:
  1. All in one place. As already mentioned, once Google Tag Manager is installed you don´t need anymore to go though each web page and modigy the source code. Every modification will be managed directly from your Google Tag Manager Platform. And this will means eficiency, speed and less dependence to IT developers for marketing people. Of course Google Tag Manager has its own learning curve. 
  2. Tags Testing. Thanks to the built-in debug console and preview mode, you test your tags and make sure they work properly BEFORE publish them to the live site. This gives more autonomy to marketing people, who will be able to quickly  test and publish tags without involving developers (at least for not advanced implementations).
  3. Versions Control. Everytime you make some change on your tags and publish it live, you will create a new version. Previous versions are archived and you can go back to them in case you need it. This makes your tags much more organized.
  4. Built-in Tags. Google Tag Manager includes built-in tags like classic Google Analytics and Universal Analytics tracking codes, Adwords conversion, retargeting, etc. It also includes some great "Event Listeners" tags which make tagging events faster.  
  5. Multi-Platform. Google Tag Manager works for websites, mobile sites, mobile apps and it´s planned to receive support for other platforms as well.
  6. Multi-Account & User Support. This is really good news especially for agencies who will be able to manage their clients tags through Google Tag Manager. Important: the client is the owner of the websites and so the tags! This means it´s the client who should set up a Google Tag Manager account and then grant permission to agencies to manage tags (same best practice used for Google Analytics accounts).

How to Upgrade to Universal Analytics using Google Tag Manager, in 10 Steps


1) Create a New Property (directly in Universal Analytics)


As mentioned above, the idea is to first test Universal Analytics tags through a property test, without touching current Google Analytics configuration.

To create a new property in Google Analytics, from the Admin panel open the Property menu and click on "Create New Property". Name the property, type your website URL for which you are doing the upgrade, set the reporting time zone and click on "Get Tracking ID" button.

You now have a new property available in your Google Analytics account, and also the related Universal Analytics tracking code (all new properties from now on are created directly in Universal Analytics). Don't do anything with that tracking code for now. You don't need to paste it into your website pages as you will use Google tag Manager later for that.

2) Create a Google Tag Manager Account


Sign-in into the Google Tag Manager homepage with your gmail account, and click on "New Account". Name your account, in my case my account is called "Marco personal". The account structure in Google Tag Manager is pretty much similar to Google Analytics, so if you are familiar with that it should be very easy.

Google Tag Manager Create Account  


3) Create a New Container into Google Tag Manager


Enter the account you have just created, click on "New"-> "Container" and name it. A good practice is to name the container after the website (or mobile app) your are going to manage tags for. I've named my container simply "analytics for fun".

You now have a container tag, which is a snippet of JavaScript code that you will add to your website pages. That will be next step.

Again, in terms of admin structure, container is similar to a property in Google Analytics. Within same account you can have one or more containers (each container assigned to a single website/mobile property), but a container can belong to only one account. Of course, also in Google Tag Manager you have User Permission configuration, but I am not discussing it here. 


4) Paste Google Tag Manager Container Code into your Site


Copy the container snippet you obtained in previous step, and paste it immediately after the opening <body> tag on every page of your site. Remember that we are not going to remove old tags from the site yet: tag manager tags and old ones will cohexist for sometime.

[In my case, as my site is hosted on Blogger, I had to paste the container snippet with a little variation in the code, to make it work properly. Details about how to adjust GTM container snippet for blogger is available here]

GTM container snippet in Blogger

*Wherever your website or blog is hosted, a savvy thing to do would be to save a copy f your current blog template as a backup before adding the snippet code. Just to be sure.


5) Now you can Start Adding Tags with Google Tag Manager


Go back to your Google Tag Manager, select your account and clicks on your site container. The tags page will appear: to add a tag you have to click on New-> Tag, select the tag type and specify the rules for when the tag should fire. The idea is to replicate your exisiting hard-coded tags, and of course add new ones if you like.

To add tags, definitely you need to have some knowledge of how Google Tag Manager works: rules, macro, data layer, etc. To be honest, the learning curve is not that easy and I am not going to delve into it in this post (I might write a post in the near future with specific examples of tags implementation).

To make things easier, below I broke this step into two sub-steps: Universal Analytics basic tracking tag and other additional tags.

5a. Add Universal Analytics basic tracking tag

First of all you might want to add the basic Universal Analytics tracking code, so that you will be able to see your site data into Google Analytics. This step is very easy and you should be able to do it even with little knowledge of Google Tag Manager.

In Google Tag Manager, select your account and enter your site container. Now click on New> Tag. Fill in the highlighted sections as in the image below.

Tag name: I named it "Universal Analytics" (you can name it differently if you like)

Tag Type: from the pre-definer tags in the menu select Google Anaytics>Universal Analytics

Tracking ID: here you have to enter the property ID you want to track with this tag. Enter the ID of the new PROPERTY TEST YOU CREATED IN STEP 1.

Track Type: select Page View

Firing Rules: add a Rule like in the picture below, that will fire the Universal Analytics tag on all pages of your website. Note that this is a pre-defined rule of Google Tag Manager, so you will find it withing the exisiting rules.

Finally click on Save. You now have a Universal Analytics tag available in your Google Tag Manager. But it has not been implemented yet.


Universal Analytics Tag in Google Tag Manager


Universal Analytics Tag Rule


5b. Add other Tags (recreate old tags with GTM) - optional step

As I mentioned above this will require more in-depth knowledge of how the tagging tool works, and I am not going to cover it in this place. But yes, the idea here is to (at least) recreate all the hard-coded tags you have implemented in your site. Such as events, tags on button clicks, forms, clicks on links, etc.

6) Debug your Tags and Publish them


This is a very useful feature provided by Google Tag Manager: you can test your tags and make sure they work properly BEFORE publishing them to the live site.

In your site container main menu, click on Preview>Debug to enable Debug mode. Now visit your website with your current browser session. When debug is enabled, a console window will appear at the bottom of your browser, showing detailed information about your tags, including firing status and what data is being processed. Check out the Preview and Debugging documentation for more details.    

The picture below is a screenshot of my debugging session to test the Universal Analytics tag.  You can see at the bottom of the page that the Universal basic tag is fired on pageviews properly.

Universal Analytics Debug

Now that you checked the Universal Analytics tag (and additional tags/events you implemented) works fine, what you will do is to CREATE A VERSION OF THE CONTAINER and eventually PUBLISH IT LIVE. From your container main menu, click on Create Version first, and eventually click on Publish (remember to click on publish otherwise the tags will not be live!).



Google Tag Manager Container Version

Great!

From now on, the Universal Analytics code is live and your site is properly tracked by Google Analytics within your property test. You can see data by opening any GA report inside your property test (actually you can notice that GA also collected the data of the preview visit you did during the debugging stage). 

You can easily double-check that GA is tracking ok, by opening a Real-Time report while you navigate into the site.

7) Assess Data Discrepancies with Old Tags Implementation   


Here is a crucial step of the upgrade process I suggest in this post. Basically we want to make sure we are going to get the same quality of data as before. So, compare the data you are receving on your test property through the Tag Manager implementation, with the data you are receiving through hard-coded implementation.

I suggest collecting enough data to make a significant comparison. Keep the Universal Analytics tags cohexisting with old hard-coded for sometime (a couple of days/weeks, I guess it depends on your current implementation and size of the site). Collect the data, analyze it and evaluate possible discrepancies.


8) Upgrade the old property to Universal Analytics


Once you have you have compared the data and are happy with the results (Universal Analytics data look right), you will finally upgrade your "old" Google Analytics property to Universal Analytics. Via Google Tag Manager, obviously. This means reaplacing completely the old tags with new Universal tags tcreated through Google Tag Manager.

Go back to your Google Analytics old property and transfer it to UA. In the Administration panel, click on Transfer to Universal Analyticss. It shoul take 24 hours to make the transfer. Once completed, you will see it displayed in green "Transfer Complete" as below.

Universal Analytics Transfer Complete


9) In Google Tag Manager, Replace Property Test Tracking ID with Old Property ID


Go back to Google Tag Manager and replace the UA property test Tracking ID  with old property ID.
By doing this trick you will be able to re-use the container you have created (with all the tags you added), with the old property ID.

This means continuity of data: in the same old property you will be able to see both historical data (measured so far with old GA tracking code) and new data (measured from now on with Universal Analytics traking code impemented through Google Tag Manager). 

Google Tag Manager Tracking ID Replacement


10) Remove hard-coded tags from your site


Immediately after step 9, remember to remove old GA tags manually added into the source code. This is to avoid having duplicated code on the site, which will obviously cause measurement inaccuracies (e.g. very low bounce rate and distorted quality page metrics).

If you decided to keep some tags hard-coded (that is you did not replicate them in Google Tag Manager), I think you could that. However, for an optimal implementation Google recommends upgrading all tags to Google Tag Manager (of course remember that now you are using Universal).



I hope you found the above steps clear. By following this upgrade process, you will be able to test Universal Analytics before implementing it completely and replacing hard-coded tags. And very important, at the same time you will also move to Google Tag Manager paltform, which will make managing tags a much easier task in the future.

What was your experience with the Universal Analytics upgrade process? Do you feel the quality of your data have been affected by the new implementation? Or have you followed a similar process as the one in this post?


You thought now.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.