Setting up Google Tag Manager (GTM)

Setting up a Google Tag Manager (GTM) Account

Firstly  you’ll need to create a GTM account and add this to your site.

Go to https://tagmanager.google.com/. You will be automatically presented with the account signup page.

Step 1: Create a GTM Account 

 An account is made up of GTM containers. It can have up to 500 containers (according to Simo Ahava in 2017  - see here). So you will want your initial account name to be quite generic - with subsequent container names to be quite specific. Go with your company name here, e.g. My Company.

When you create an account for the first time, you also need to create a container. Think of a container as one “GTM implementation”. You may have GTM running for your website. This would be one GTM comtainer. You may have one set up for your app. This would be another container. As above, an account groups all these containers together under the one umbrella. So be a bit more descriptive with your container names. We recommend to use your website name.

Choose web here if you are tracking a website. Choose one of the other options if  you are tracking an app etc

Step2: Enter your account details 

Once created you are given the GTM terms of service. Scroll through and click Yes to proceed.

GTM Terms of Service Agreement 

Finally you are presented with the GTM code snippet to place on your site. This is actually two snippets. One is javascript and should to be placed in the <head> section of your web site (as high as possible is the Google recommendation - so the GTM script loads as soon as your page starts loading).

The other is a iframe wrapped in a noscript tag. This is to cater for browsers that have javascript disabled. When javascript is turned on this code will be ignored. When its not, the iframe request will be made to google’s servers. As of 2015, this code could not generate any custom html - which is an important application within GTM (see Lunametrics great explanation here for more info).

This should be placed as close to the opening <body> tag as possible. 

A word on placement. In reality these code snippets can be placed anywhere on your page. It is not ideal, but they will generally still work fine however the risk that they do not load is much higher - especially for slow web pages.

Step 4: The GTM code snippet  

Installing GTM onsite

This is the tricky part. GTM needs to be placed on every page of your site. If you are not a developer or know how to access your page/header templates this may be daunting.

But in reality - most Content Management Systems (CMS’s) systems these days have a plugin for GTM readily available. All you will need is your GTM account id from the code snippet above. For wordpress - the CMS that this website is built in we use the popular DuracellTomi’s Google Tag Manager for WordPress plugin, by Thomas Geiger. This performs well, however by default it installs GTM in the footer of your site. You can choose to place it in the header of your site (as we do, with no issues) but on some websites it can cause formatting issues, especially to css files. We have seen this on some client sites.

There are a whole host of similar plugins in GTM. And a whole variety for other popular CMS systems. Here is a list of plugins we have encountered for other systems:

And you are DONE! 🙂

Continue To Setting Up Google Analytics Tag:

Now you are done you will likely want to install a Google Analytics pageview tag on your site. To continue the “Setting Up Google Analytics” guide through GTM click here: 

http://www.tribalism.com.au/knowledge-centre/setting-up-google-analytics/