Introduction to Google Tag Manager

In the Mont Blanc release we added support for Google Tag Manager, which is a tag management system by Google that makes managing code for tracking, marketing and A/B testing easier. It works by replacing all the hardcoded calls to the tags in your code with a single snippet of code, which GTM calls a 'container'.

In this article I'm going to talk about the benefits of using a tag manager, specifically GTM, and the container generator tool we created to aid you in the setup process.

Benefits

So I just want to run through some of the features of GTM so you'll see why we think it can be beneficial on your site.

Performance

It's an old addage in ecommerce that the faster your site is, the more likely you'll get conversions. Shoppers get frustrated having to wait for things, and this true whether they are shopping offline or online. So you need to make your site as speedy as possible.

In order to do this, you need to keep your site as slim as possible: cut out all the fat that's slowing it down. If you add numerous third-party scripts for analytics and advertising, then you force your customers to load and send a lot of data.

GTM replaces all of the individual calls with a single one. This means that it doesn't matter how many you want to use, as the request is made is to the GTM service. GTM then makes the data available to your individual tracking services via data layer.

Make it Non-Technical

Adding or modifying tracking tags usually requires developer time: they need to change some JavaScript or a configuration. And this is a problem because non-technical people either don't know how to do these changes or don't have access to the site's source code.

By using a tag manager, the source code only ever has to be changed once — after that you can add, modify, remove or test new tracking tags using the GTM control panel. Theoretically, it means that changes can be made by backroom or other non-technical staff, and developers are freed to work on the site.

Debugging and Versioning

There's a lot of safety in using GTM. If you implement a new tag and it doesn't seem to work, there are in-built tools in GTM that can give you clues as to why. It also means that GTM catches these problems before you push your changes live, rather than risking the integrity of your site.

If you don't manage to catch problems before you go live, you're able to rollback your changes quickly and easily using their inbuilt versioning system.

Implementing GTM

In fact, there are a lot of other good reasons to use GTM but I hope by now you're on board. Lucky for you, we have written up an excellent guide to getting started with it on the Implementing Google Tag Manager page.

All the details are in that document, so I won't go over them there, but there are four steps you need to do:

  1. Sign up for GTM
  2. Add your GTM number to the SCA configuration file
  3. Use the GTM container generator
  4. Import the generated file into GTM

It's this third step that I'm going to talk a little. As part of the setup process, Google asks you if you want to import a container. We recommend doing this for two reasons:

  1. It speeds up the setup process
  2. It reduces the likelihood of errors

You can find the tool in the tools section of the site.

The container file is JSON. After submitting the relevant details of your accounts into the form the JSON file is created, populated with your details and downloaded onto your computer. Then, during setup, you import it into the Google Tag Manager control panel.

Summary

Tag management systems, such as Google Tag Manager, offer a lot of benefits to sites that have implemented third-party tracking tags, such as Google Analytics. Whether you have one, two or more tags, you can see the benefits in performance, control, and safety.

In order to aid the setup process, we have added some documentation and a tool that generates a container file for you. Importing a pre-generated container file into GTM reduces the likelihood of errors and can save you time.

Further Reading