Google Tag Manager: Making the move (Getting Started Guide)

Follow me

Jay Dillon

Director of Strategy and Creative at Inbound Experts
Jay is a digital marketer and producer whose creative and technical skills have developed digital brand strategies and sales campaigns using a range of complex internet applications from stand-alone websites through to Facebook API integrations.
Follow me

For many of the marketing teams that we work with, data analytics is often the part of their Inbound Marketing strategy that they fear the most.  Google Tag Manager is a relevantly new product from Google that aims to at least make one part of data analytics a bit easier to manage for the less technically inclined marketing manager. The official Google Tag Manager Page greets you with: “Digital marketing made (much) easier.” While this may be true for long-term project/tag management, I’ve come to realise that the initial learning curve for GTM can be somewhat…overwhelming. So we’ve decided to include an article providing the basics on how to manage this great tool, what you need to get started along with very helpful links, videos and screenshots. Is it worth it to get past that initial learning curve with GTM? The answer is a solid YES. Why? because, if used well, it will save you a whole heap of time.

WHAT IS GOOGLE TAG MANAGER?

GTM’s main page also includes the following question: “Want to focus on marketing instead of marketing technology?” In other words, GTM offers a free solution for tag management, especially for marketers and businesses that aim to convert visitors into customers. Tagging is critical to effective performance tracking and GTM is a rather simple, powerful way to manage all your analytics, conversion tracking and remarketing tags.

In the past, almost everything was controlled by webmasters, including website tracking (which was highly technical since it required handling log files). But then, in 2005, Google made the JavaScript method widely available in Google Analytics…yet it still demanded a technical integration by webmasters because it required adding codes to the websites. So when Google realised that many modern marketing tools (analytics, tracking, etc.) depend on adding “tags” to your website it decided to do something about it. And so, in 2012, it announced the launch of a new free tool on its Analytics Blog, one that consolidates your website tags with a single snippet of code and lets you manage everything from a web interface. One where you can add and update your own tags with a few clicks whenever you want, without bugging those IT folks or rewriting site codes. This allows marketers to have greater flexibility and webmasters to focus on other important tasks.  Hence the “instead of marketing technology.” But first things first, if you haven’t already watched the widely viewed intro video (very good visual intro for all rookies) here it is:

 

Tools You Need (and should probably already have)

1.     Google Chrome: Chrome has a nice JavaSCript console and supports a couple of useful extensions.

2.     Tag Assistant: not required but at times useful to give extra info.

3.     A Google Analytics account

 

STEP 1.  YOUR ACCOUNT 

Typically, only one account is needed per company. Tags for all the company’s websites can actually be managed from this account by creating new containers. In order to create an account (watching the intro video should take you step by step) just visit google.com/tagmanager and signup for the product.

To create additional accounts, sign in to your existing one and click on “Accounts List” (found on the drop-down on the top-left corner of the page) and click on the “New Account” button as shown on the screenshot below:

tag-manager-account

You can use your business name or anything you prefer to reference your site:

screenshot3

STEP 2. Containers

A container holds all the tags for a specific website; it should be named after the website it is being used for. If you have a blog, landing page, etc. on a subdomain, you can track it in this same container:

zadro-web-gtm-container

STEP 3. After you have created your account and container, you will be provided with a snippet of code that you must add to your site right after the <body>tag. Please remember, you will be using GTM for Google Analytics, so your GA code can now be removed. And, on this same page that provides your code snipped, there will also be the option to include GA and/or Adwords right away, along with some other standard options.

The first thing you need to do is create a new tag (below). Give the tag an easily recognizable name such as “Google Analytics” and then set up the tag type as either Classic Google Analytics or Universal Analytics depending upon which version is currently in use (Or take the time to update to “Universal Analytics” prior in your Google Analytics account):

image1

 

 

screenshot4

*Sidenote: If you are planning to upgrade a classic Google Analytics account to Universal Analytics, please be aware that Universal Analytics currently has numerous features such as Remarketing and Google Display Network Impression Reporting still unavailable.

STEP 4. Add the relevant Analytics ID to Web Property Id and set the tracking as Page View:

image 2

STEP 5. We have now created the Tag for Google Analytics but need to define rules that will allow the Tag to fire and pass information back to Google Analytics.

  • Click Add on the firing rules section of GTM:

Image 3

  • Check the predefined rule for all pages:

image 4

  • Save the Rule.
  • Save the Tag

And that is how to basically move Google/Universal Analytics into GTM.

The final step in this transition is to remove the existing Analytics code from your website and install the new general tag. To do this first copy the new tag by going to ‘Admin’ then ‘Install GTM’.

Then paste this immediately after the <body> tag in your website (e.g header.php file). Be sure to delete your current Google Analytics tag if there is one there.

SETTING UP EVENT TRACKING

GTM uses slightly different mark up to track events when compared to the Event Tracking that you may be familiar with in Google Analytics. To make sure Event Tracking continues to function correctly we need to change any _gaq.push instructions that already exist on our site.

1. Create a new tag

image 5

2. Set the Tag Type as either Classic Google Analytics or Universal Analytics depending upon which version is in use and then enter the Analytics ID into the Web Property ID:

image 6

3. Set the Track Type as Event:

image 7

4. Then a Macros needs to be created that can be used in the Event Tracking Parameters. To do so, click on the symbol to the right of the Category field:

image 8

5. Set the Macro name so it is easily recognizable in the future and carry out the following actions:

-Set Macro Type as Data Layer Variable

-Set Data Layer Variable Name as gtmCategory

-From the Data Layer Version drop down menu, select Version I

image 9

6. Save the Macro and repeat Step 5 for both the Action and Label fields. You should end with three newly created Macros that have the following information:

Screen Shot 2014-05-12 at 12.03.41 AM

7. Finally you need to create a rule to fire this Tag. Select the Add Firing Rules option and create a recognizable Rule Name (e.g. GA Event Trigger).

image 10

8. Define the Conditions for the rule as: {{event}} equals trackEvent:

image 11

9. Save the rule and you should have an Event Tag that is ready to go with the following set up:

image 12

CHANGING TRACKING CODE IN HTML

10. The final action that is needed is to modify any existing event tracking in the side code to ensure it functions correctly.

Previous Event Tracking for Google Analytics would look something like:

 

onclick=“_gaq.push([’_trackEvent’, ‘Cars’, ‘Twitter’, ‘302366’]);

 

These lines of code should be replaced with the information used to create the Macros, resulting in the following:

 

onclick=”dataLayer.push({’event’: ‘trackEvent’, ‘gtmCategory’: ‘Cars’, ‘gtmAction’: ‘Twitter’, ‘gtmLabel’: ‘302366});”

 

Use the image below as a guide to find where each Macro fits into the code:

image 13

Creating and Testing a Version

11. Finally you can check that the implementation of GTM is working correctly. First you need to check that tags are firing correctly before pushing the GTM code live. To do so, enter the Debug Mode, which can be found under Preview in the GTM:

image 14

This will load the site with GTM with a list of tags at the base of the page:

image 15

Navigate around the site loading pages and click on elements that have Event Tracking applied to them to check status.

12. Once you are satisfied and everything is working correctly, click Create Version. It is important to take note that Create Version does not make the tags go live. In order to make the new version live click Publish.

13. Finally, to check that the new Event Tracking is working correctly just open up Google Analytics. Within Analytics, open the Real Time tab and select Events:

image 16

14. Head over to your site and click on a few elements where Event Tracking has been applied then Refer back to Real Time Events in GA and check that the events have been correctly tracked:

image 17

AND THAT IS IT FOLKS! you have now migrated your Google Analytics account and Event Tracking onto GTM. If you’re still having some doubts, here is a great link directly from the source to define some of the terms and understand how GTM works with Adwords and GA. While it seem tedious and consuming, it’s a really great way to become familiar with Tag Manager and all its main functions. Try it out and start building up your expertise.

More articles from Inbound Experts

How to use Twitter (properly)

Twitter can be an amazing platform for connecting with an audience. However, many struggle to get the hang of it. If you are just getting started or feel as if you are not making the most of Twitter, download this free guide for going from zero to hero.