Skip to main content

Try our fabulous 5 Day SEO Challenge Let's Go

Using Google Tag Manager for Google Analytics

Google Tag Manager

Always one to want to try out new things, I have been toying with the idea of using Google Tag Manager for a few weeks now.  There have been a few deadlines however and I have been postponed in my investigations and subsequent playtime.  That all changed today.

I had been asked to do some work for a family member and whilst I could get away with adding a the GA code into the <head> tag as is usual, I thought I would use this as an opportunity to play with the Google Tag Manager.

I logged into the Google account that is associated to the website, and I added GA and I then went on to add GTM.  Exciting stuff?  Maybe not enthralling, but something new to be sure.

Get Started with Google Tag Manager
Google Tag Manager – Get Started

So having added GTM to the Google account I then went into the GTM control panel.

I added a new account, name set at the domain name

Create an Account with Google Tag Manager
Google Tag Manager – Create an Account

I added a new container, container name set to the domain name also.

Create a Container with Google Tag Manager
Google Tag Manager – Create a Container

Google then displays their Google Tag Manager Use Policy for acceptance

Google Tag Manager Use Policy
Google Tag Manager Use Policy

I received an erroneous message when I accepted this:

Object Object Message with Google Tag Manager
Google Tag Manager – Object Object Message

I ignored it and moved on, like the hardened professional that I am.

The container code is generated and displayed.

Container Code with Google Tag Manager
Google Tag Manager – Container Code

This will need to be copied after the opening <body> tag of the website pages for which it will be used.  Using WordPress, this will most often mean altering the header.php file of the theme being used, and in Joomla this will most likely be a modification of the template folder index.php file.

I was then given the option to add a tag from a default set of commonly used and available tags.

Add Tags with Google Tag Manager
Google Tag Manager – Add Tags

From the available selection I chose Google Analytics, having created my GA account prior to this.

Add New Tag with Google Tag Manager
Google Tag Manager – Add New Tag

I added a tag, and provided the following information:

Name: Google Analytics

Tag Type: Google Analytics

Web Property ID: UA-xxxxxxx-x (please replace x’s with GA account UA id)

I left Add Display Advertiser Support unchecked.

Track Type: Page View

Add New Tag Completed with Google Tag Manager
Google Tag Manager – Add New Tag – Complete

These settings were saved.  It was unlikely that I was going to get better than that.

I then clicked on the button labelled ‘Add Rule to Fire Tag’:

Add Rule with Google Tag Manager
Google Tag Manager – Add Rule

The existing rule was probably fine, but I went out on a limb and clicked on the Create new rule radio button, the following expansion of the window occurred (please note that I show the completed form here).  The value in the textfield is the domain name for the URL that the Google Analytics code is to be associated to.

Create New Rule with Google Tag Manager
Google Tag Manager – Create New Rule

I then clicked save.  This returned me to the Add New Tag page with the rule added

Add New Tag Completed Rule with Google Tag Manager
Google Tag Manager – Add New Tag Completed Rule

With all set up and ready to roll, we can now save it all, and see how we have done according to the kind people at Google World.

A summary screen is then provided to allow us to view all the details that I’ve provided.

Summary with Google Tag Manager
Google Tag Manager – Summary

It can be seen that 2 rules apply; the original RegEx and the one that I added labelled as Google Analytics.  At the top it is also seen that this has a status of ‘unpublished’.

Select the Version – Overview, from the left hand menu.  This will open up a new set of details in the main area on the page.

Version with Google Tag Manager
Google Tag Manager – Version

From here select to create a new version by clicking on the button on the right of the page.

Create Version with Google Tag Manager
Google Tag Manager – Create Version

Then click Save and Preview.  This will generate a new version of the container and allow you to see if all the modifications that you have made are working as expected by providing a preview of the page.

Save and Preview - Preview Confirmation with Google Tag Manager
Google Tag Manager – Save and Preview – Preview Confirmation

A link to the website is provided for a preview to be made of the website.  It can be seen from the window which version of the website this is (Version 2).

The website will open when the link is clicked, and at the bottom of the screen an output of whether the tag fired.

Preview Version 2 - Google Tag Manager
Google Tag Manager – Preview Version 2

It can be seen here that it has been a success!  Time to break open the bubbly and get on with something else productive!

I hope that has been helpful, but if you have any questions do not hesitate to let me know.

Have a great day!

* For more information and our gratitude for the header image, visit http://analytics.blogspot.co.uk/2012/10/google-tag-manager.html

For more information on this and other Google products provided in easy to digest video formats have a look at: http://www.google.com/ads/experienced/webinars.html


WebHolism

We're an eco-loving, organic pixel creating, solar powered website conjurer who lives to help companies discover their awesome potential. Our specialities are WordPress websites and SEO. We also give really good hugs.

Leave a Reply

Your email address will not be published. Required fields are marked *