Many of us have Google Analytics installed on our websites (if you haven’t, it is highly recommended that you do install it). It provides us with a plethora of information, essential for understanding our digital marketing efforts and the impact they are making on our goals and objectives, and planning our next moves.
A tool which many of us aren’t using, however, is Google Tag Manager:
Google’s Tag Manager software essentially allows you to place snippets of code on your website without actually having to touch the site’s code (minus a 1-time installation). It allows you to easily add not only Google software (such as Analytics and AdWords), but also third-party software (such as Hotjar and Infinity Call Tracking). For most of these tags, you’ll only need to enter 1 or 2 pieces of information (such as a Google Analytics ID), and Google does the rest. If you can’t spot the software you’re after, you can easily add it using the ‘Custom HTML’ tag (an example of this would be Facebook Pixel).
The main advantage of Tag Manager is how easy it makes adding these tracking codes to your website. One of it’s most useful features (and we’ll explore this in more depth in another part of this series) is the ability to easily add event tracking (read more about event tracking here).
To install Tag Manager on your website, navigate to tagmanager.google.com and sign in with your Google account.
Next, click the the ‘Create Account’ button, enter your company’s name and click continue:
Now enter your website’s address, select ‘Web’, then click the create button:
On the next screen you’ll see this popup. This is the code you’ll need to add to your website, the first snippet in your website’s header (between the <head> and </head> tags), and the second in your website’s body (just after the <body> tag). If you’re comfortable editing code, you can install this easily (if you’re using WordPress look for your ‘Header.php’ file, you’ll most likely be able to install this here), if not, send the code over to your website’s developer (Note: Copy the code snippets into a Notepad document when you send them over, DO NOT copy them into Word as this will format the code):
Once the Tag Manager code has been installed on your website, click ‘New Tag’ to add your first tag:
On the right-hand side, a screen will popup. ‘Tag Configuration’ allows you to add the code snippet, and ‘Triggering’ will allow you to choose when the given code snippet will fire. Select ‘Tag Configuration’:
Then select Universal Analytics to install Google Analytics:
Once you’ve selected Universal Analytics, you’ll need to navigate to your Google Analytics account (keeping the Tag Manager tab open) and find your website’s tracking ID:
Once you’ve found your website’s tracking ID, head back to Tag Manager and enter it in the ‘Tracking ID’ field. Leave the ‘Track Type’ dropbox field as ‘Pageview’:
Now we need to tell Tag Manager when we want our Google Analytics tracking code to fire. To do this, we need to select ‘Triggering’:
Once the right-hand window has loaded-up, select ‘All Pages’ – this tells Tag Manager that we want our Google Analytics code to be on every page on the website:
Our tag is now finished. All we need to do is name it and click the save button:
Now that we’ve created our Google Analytics tag we need to do 3 things:
- Preview our website
- Publish our changes
- Remove the old Google Analytics code from our website
1. Preview Our Website
The work we do in Tag Manager doesn’t automatically go live on our website. Instead, we need to ‘Publish’ our changes. First though, we need to check that what we’ve done is firing ok. So, to check, click the dropdown arrow next to the ‘PUBLISH’ button and select the ‘PREVIEW’ button:
Once the page has refreshed, you will see this block appear:
Once you see this block, open a new tab in your browser and navigate to your website. Once you reach your website, you’ll see a pane appear at the bottom of the screen. This gives you information on what Tags are firing on the current page. If you see the Google Analytics tag on here (or whatever you called it), this means the tag setup was successful:
2. Publish Our Changes
Now that we’ve tested our Google Analytics tag, we need to publish the container to make our changes live on the website. To do this, return to Tag Manager and click the ‘PUBLISH’ button in the top right-hand corner. Another pane will pop-up on the right-hand side, click the ‘PUBLISH’ button on here also, you’ll then see a popup appear, click ‘CONTINUE’ on here. Now your container will be published to your website.
3. Remove The Old Google Analytics Code From Our Website
Now that Tag Manager is sending information to Google Analytics, you’ll want to remove the code GA code from your website’s header. Again, if you’re comfortable editing code this can easily be done, otherwise please consult your developer.
Once this is all done, check in Google Analytics that visitors are being tracked by viewing the ‘Real Time’ report.
Part 2 – Event Tracking
The next step in utilising Google Tag Manager to it’s fullest is using Event Tracking. Read part 2 in this series here.