What is a Tag Management System?

If you use Google Analytics (GA) then it’s probably time to start taking advantage of the many benefits Google Tag Manager (GTM) has to offer.

GTM is Google’s free-to-use tag management system that, conveniently, also integrates the company’s other digital tools, such as AdWords, DoubleClick and Trusted Stores. We’ve been eulogising, both internally and to clients, about the benefits of having a tag management system (and in particular GTM) for ages now, so I wanted to share an introductory guide for those of you who aren’t familiar with the system.

So what is a Tag Management System? Simply put, tags are snippets of code that sit within either the <head> or <body> elements of a web page which enable tracking, analysis and reporting.

Tag management software is a way for marketers and developers to apply these snippets of code to their website via a user-friendly interface, meaning you don’t have to ask your web developer to do it for you.

Tag management systems enable several tags, including for third-party properties such as AdRoll, to be inserted into one all-encompassing container. Where previously you had several code snippets, these are replaced by the tag management code.

What does Google Tag Manager allow me to do?

GTM enables webmasters to give specific permissions to certain users so that they can access different sections of the system. For marketers, it allows them to decide when tags should be ‘fired’, dependent on certain conditions (triggers) defined by the user.

For example, if you’re using Google Analytics you would usually wish to fire the tag on all pages across your website because you’ll want to be able to analyse traffic data for all of your pages. You may also wish to set up event tracking within Analytics, such as external link clicks or form submissions. You can tailor your events to only record when the appropriate triggers are met.

What are the benefits of a tag management system?

If you’re not a web developer, the idea of delving into your website’s HTML and playing with the code might seem like a very daunting prospect indeed.

Tag management allows you to implement tracking and analysis code snippets easily onto your website, without having to worry about possessing coding skills or bothering your IT guy. All you need to do is add the tag into your management dashboard and it will appear on the pages you designate.

By using this process you can improve the efficiency of your organisation and rely a lot less on your developer, instead making website changes yourself (there is a small caveat to this, but more on that later).

Additionally, was only previously possible with the help of a webmaster or developer, but with the help of GTM marketers can take control over this process.

What is Google Tag Manager’s structure/hierarchy?

GTM’s structure has accounts at the highest level, and containers within those accounts. You then set up tags, triggers (formerly known as rules) and variables (formerly known as macros) within each of those containers. GTM’s hierarchical structure is shown below:

Screen Shot 2018-02-26 at 14.11.48

Accounts can include a company or organisation, with lots of websites (such as a restaurant chain with different websites for each restaurant), or a small local company (like a local store) with only one site. Containers hold all the tags relating to one website or mobile application. For the purposes of this guide, we’ll focus on one website installation, but you can see an example GTM account structure below:

Screen Shot 2018-02-26 at 14.14.13


Add analytics on staging & live sites with Google Tag Manager

Over the years GTM has become an increasingly important part of our marketing efforts here at Klood Digital. As a result, I’ve written a few articles on the subject, as well as an article for Advanced Web Ranking on on your website.

In two of those articles I’ve explained how, instead of inserting your Google Analytics property ID every time, you can use a variable that will populate it instead. That way you only have to put your property ID in once and GTM will insert it on your behalf. Using this method, you can also dynamically change the ID based on certain inputs, such as your website’s hostname (more commonly referred to as the domain name).

How can I set up Google Tag Manager on my website?

Firstly, head over to and sign in at the top right hand corner.

Screen Shot 2018-02-26 at 14.16.33

Screen Shot 2018-02-26 at 14.17.54

If it’s the first time you’re signing up with your email address, follow the instructions and enter your account name (usually the name of your organisation):

Screen Shot 2018-02-26 at 14.19.33

You then enter your domain name into the ‘Container name’ field and choose where to use your container - on the desktop version of the website, on iOS and/or Android:

Screen Shot 2018-02-26 at 14.20.53

Click ‘Create’ and you’ll be presented with a screen asking you to add the container code onto every page of your website, as well as the code itself:

Screen Shot 2018-02-26 at 14.22.04

This code can be added in using your content management system (CMS) by editing one of the template files. Make sure the GTM code snippet is inserted immediately after the opening <body> tag, and that any old instances of Google Analytics codes are removed to avoid double counting users.

This stage should be the only time when you might require the help of a developer or webmaster. This might not always be the case, as you may need assistance tackling ID or class issues relating to event tracking.

Adding your first tag

Now that you’ve added the container tag to your web pages, it’s time to create your first tag, and this will typically be the Google Analytics snippet. From the GTM dashboard, click on ‘Add a new tag’:

Screen Shot 2018-02-26 at 14.24.39

You then have to select which property you wish to create a tag for. For this example we want to select Google Analytics:

Screen Shot 2018-02-26 at 14.25.03

After choosing Google Analytics you will need to name your tag - something simple like ‘Google Analytics’ will suffice - however naming conventions are quite important should you start to implement more complex installations later down the line. You can refer to to help you determine your own architecture. You should then choose a tag type:

Screen Shot 2018-02-26 at 14.28.13

‘Universal Analytics’ (UA) is chosen by default, but depending on the version of GA you use, you may need to select ‘Classic Google Analytics’. However, you should probably see this as an opportunity to to take advantage of the benefits of doing so.

You will then need to enter your GA tracking ID, which can be found by going to your Analytics dashboard.

Screen Shot 2018-02-26 at 14.34.32

Copy and paste the tracking ID into the field below:

Screen Shot 2018-02-26 at 14.35.47

You can also set up your own variable within GTM that dynamically pulls in the GA property ID into your container, to save you the hassle of copying and pasting the code each time.

In the above image, you can see the dropdown selector “Track Type”. The ‘Track Type’ will be Pageview by default, but you can leave this as it is. I’d also strongly recommend ticking ‘Enable Display Advertising Features’ to start pulling in demographic data into Analytics, but this does , so make sure yours is up to date before enabling this feature.

You shouldn’t need to access any of the advanced features at this time, but you will have to set a firing trigger.

Firing triggers detail when the tag will become live and in this case, you should set the tag to fire on all pages because you want GA to be tracking on every page on your site:

Screen Shot 2018-02-26 at 14.38.31

By clicking on ‘Create Tag’ you will save it, but it won’t be live yet.

Preview Mode

It’s very important to preview your tags before setting them live to see if they are firing when they’re supposed to.

Screen Shot 2018-02-26 at 14.40.42

When preview mode is enabled, you should see the below in your GTM dashboard:

Screen Shot 2018-02-26 at 14.41.39

In order to use preview mode, visit the URL of your website, and you should see a pane at the bottom of your browser window:

Screen Shot 2018-02-26 at 14.42.34

Publishing your container

Once you know that all your tags are firing, all you need to do is click publish. To double check that it’s working first, head over to the Real-Time report in GA to check that your visits are being recorded. Unless you have your IP filtered out of the view you are reviewing, you should see live statistics of what page you’re looking at. If you make any changes in GTM, you will need to refresh preview mode in order to see them on the site, so please bear that in mind. 

Once you’re satisfied your Google Analytics tag is firing correctly, click the Publish button on your GTM console.

Fortunately, GTM includes version control to ensure you can’t accidently overwrite your tags, allowing you to return to a previous version if you do make any errors.

Screen Shot 2018-02-26 at 14.44.08

The Benefits of Google Tag Manager

Universal Analytics has been out of beta for a couple of years now, so if you haven't upgraded to Google's most recent iteration of Google Analytics, you should consider using GTM to complete the implementation - and the above guide can assist with this. It’s worth noting that , but first, let’s cover off what tags are.

For the uninitiated, I'll (try to!) provide a very simple definition. Essentially, tags are snippets of code - usually javascript - that execute a specific function on your website. For example, the Google Analytics snippet is a tag.

Tags also enable you to measure the impact of advertising on your site, use remarketing and retargeting, and much more. But why should you use a tag management system?

Why should you use a tag management system?

Tagging can get pretty complex. Larger websites in particular can have lots of tags or code snippets that need to be added, require updating regularly or have complex installations, but it’s not just the complexity involved, and there are several other reasons why you should use a tool to manage all your tags - and in particular GTM.

  1. GTM is free and future proof

Tag management systems are not a new invention - they've been around for a few years now - but most of them charge a fee for the use of the product. Google's is free, which makes it very appealing. It's very similar to Microsoft's tactics during the ‘Browser Wars’ of the mid-90s. Give something away for free and leave the competition redundant.

Seasoned computer users will know how well that turned out for Microsoft, but Google won't make that mistake. If there's one thing they won't do, it's get lazy with their product. I believe they are acutely aware that marketers and business owners need a way of easily managing and updating their tags/code snippets without touching the code.

The iteration released by Google nearly two years ago is testament to that, refining the terminology so that ‘technophobes’ can understand the semantics. But the fact that it’s free and future proof isn't the only reason why GTM is the best thing since sliced bread (slight exaggeration).

  1. Ease of use

Within reason, GTM enables you to insert a piece of code once, without ever having to bother your web developer. This is perfect for teams with an external web developer because you are not repeatedly asking that developer to make changes. For in-house teams it also means your developer can focus on improving the website, as opposed to making changes to benefit your data, thus streamlining the process.

It also means that if you need to update any of your tags (remember what I said earlier about upgrading from Classic Analytics to Universal Analytics), you can do this yourself by updating the tag in the GTM dashboard.

  1. Pre-defined tags

Google is well aware that the majority of websites use a similar selection of tags. This isn't just limited to Google Analytics or AdWords Conversion Pixels - it also includes other tags used for remarketing purposes such as:

  • DoubleClick;
  • Marin;
  • comScore.

This is perfect for marketers who aren't familiar with code. The GTM snippet is inserted once on all pages, and all tags are inserted into pages that the rules (now known as ‘triggers’) associate with the designated tag. What’s more, Google announced support for a wide range of new tags, including HotJar and Bing Ads.

You can find the , as well as their .

  1. Debug mode

GTM also contains an option to test your tags before you publish them.

Data accuracy is becoming increasingly important (and increasingly difficult given the web spam issue), so being able to try out your implementation to ensure your tags are firing correctly is hugely important. This ensures it never affects your live data.

It’s best to review on this subject, but it’s pretty easy to get to grips with.

  1. Version control

Whilst the debug mode is great, sometimes errors do occur that may be beyond your control (think of that pesky web developer who changes the code without consulting the marketer/analytics expert). GTM is prepared for such occurrences and utilises version control, enabling you to rollback to previous versions and keep everything really organised. It can also help you implement similar installations on new GTM containers as it lists all the tags that you have implemented in that particular version.

  1. Environments

A (relatively) .

Environments enable you to control your tag manager installation across live/production websites or apps, and their development/staging counterparts.

Similar to both debugging and version control, this tag manager feature enables you to publish your tags to different environments, for example a testing server, so you don’t affect or change your live version when publishing. You can then share preview modes with others to further test your installation - incredibly useful for those more complex installations.

  1. User control & permissions

In a similar vein to Google Analytics, the application allows you to have control over who can access your setup and how much they are allowed to do within GTM. These permissions start at the ‘view only’ level, and then you can enable ‘Edit’, ‘Delete’ or ‘Publish’ permissions on a per container basis.

Within accounts (comparable to an account in Google Analytics) you can then set either ‘View only’ access, or ‘View, edit and manage’ access.

  1. Improving user experience

How can a tag management system improve user experience? Well, it can do this both directly and indirectly. Its direct impact is improving site speed.

Site Speed

Say you have several tags on your website. This results in more code to load, and potentially a slower page load time. You could even have tags on your site that are old and no longer in use.

Tag management systems only load the tag container snippet, and all the tags are housed within the snippet. You can then manage your tags all from one location (the dashboard) and speed up your site.

There are caveats to this - too many tag snippets can cause load time issues, for example - but generally, GTM should improve site speed performance.

The indirect effect on user experience comes from further implementation, which I’ll explain below.

Event Tracking

Recording events on websites is nothing new. For the those who are unfamiliar with the concept, it involves custom javascript code that you would add to a website to . GTM comes with event tracking built in - otherwise known as auto-event tracking.

The term ‘auto’ is, in truth, a bit of a stretch. There is still some setup required, but it is relatively straightforward to do. I won’t cover that tutorial here, but the basic events that you can track are based on:

  • clicks;
  • form submissions;
  • link clicks;
  • time specific.

You can also create custom events that record things such as .

Why is this important? Well, fundamentally it enables you to gain insight into what actions users undertake on your website. Are they clicking on certain links? Are they engaging with the content? Are they completing form submissions? You can then use these events to create goals specific to your business in Google Analytics.


I (still) think Tag Manager could well be one of Google’s next big pushes. With recent developments around the launch of their range of free analytics-related products, such as , the installation of these tags will become even more important. After some of their experiments that have not performed so well ( in search results springs to mind), I believe GTM to be a winner.

People need analytics. People need data. People need tools that can save them time or streamline the little resource that they have. That’s why GTM works so well. It’s not the perfect tool just yet, but they will keep improving things.

If you’d like to check out some more resources on GTM, the two I’d recommend are , and .

Tags, Triggers, Variables and the Data Layer

One of the main selling points of tag management systems is the ability to allow those less (or unfamiliar) with coding to deploy code snippets on websites or mobile apps. Most of the time, these tags are third-party tools that allow reporting, analysis and tracking. The problem is that marketers often have to get in touch with their web development or IT team to install these code snippets. With tag management, this can (usually!) all be done by someone who has little experience with HTML.

GTM has a number of different components that we need to get our head around before diving in. These are tags, triggers, variables and the data layer. I’ve given some definitions of these below:

  • Tags - a block of code - usually JavaScript - that performs a given action on your website;
  • Triggers - rules that you set in order to fire your tags. Tags are fired on events, such as a page load or button click. Triggers are attached to tags and that specifies when a tag should fire;
  • Variables - assist in defining triggers and what data they send. An example of a variable could be a webpage’s URL or the ID of an HTML element;
  • Data layer - probably the most intimidating element of GTM, the data layer is a JavaScript object that contains information that you wish to send to GTM. The idea of a data layer is that it sits in the middle of the tag management system and the website in order for you to pass data between the two. There’s a very good guide on data layers over on the .

Now we have a good understanding of the main components of GTM, I’ll talk about the problem that many marketing, analytics and web professionals face.

Data Accuracy

Data accuracy is a real pain in the back side. In theory, it should be pretty simple, but with so many people potentially influencing websites it’s easy for you data to become muddled.

From and , there’s lots of opportunities to get your data mixed up. The issue that this implementation solves is that of your development or staging URLs sessions .

During the development process of a website you should look to start implementing your GA implementation on the staging version of your website. This enables you to instruct different GA IDs to load depending on whether it’s the live or staging version of your website.

Before you begin, it’s important to ensure you’ve created a separate GA property ID for all the staging or development environments. If you’ve not done this then you’ll have to come back to GA in order to action this later on in the tutorial.

Creating the Variable

This solution creates a variable using a lookup table. Similar to the , we specify what we want Tag Manager to find, and it then delivers an output depending on what it can locate. In order to action this, head over to the ‘Variables’ section within GTM:

Screen Shot 2018-02-26 at 15.23.09

Ensure ‘Page Hostname’ is checked:

Screen Shot 2018-02-26 at 15.25.09

Click ‘New’ towards the bottom of the page:

Screen Shot 2018-02-26 at 15.26.02

Choose ‘Lookup Table’ from the options:

Screen Shot 2018-02-26 at 15.27.43

Choose ‘’ from the ‘Input Variable’ options:

Screen Shot 2018-02-26 at 15.28.47

Click ‘+ Add Row’:

Screen Shot 2018-02-26 at 15.29.44

You can then add your hostnames into the appropriate input row and your GA property IDs into the applicable output row:

Screen Shot 2018-02-26 at 15.31.28

After that’s complete, ensure you give the variable an appropriate name such as ‘Dynamic GA Property ID’. You can then click ‘Create Variable’ to save your progress.

Referencing the Google Analytics Variable

You can then go back over your previous tags, and replace the static property ID you previously used, with the dynamic one you have just generated:

Screen Shot 2018-02-26 at 15.33.08

Make sure you delete the old characters that were in the text entry box, otherwise you’ll find more information than you require populating the field - causing likely bugs with your installation.

That’s all there is to it! Of course you should do your due diligence and use preview mode to test things are working as you expected them to, but there should be no further implementation required.

There is another way that you can ensure data accuracy by using ‘’, whereby you publish your version of Tag Manager to different containers, but we’ll save that for another tutorial.

Set-up LinkedIn conversion tracking using Google Tag Manager

If you’ve been using the LinkedIn advertising platform you will have been able to see how many impressions those ads have had, the number of clicks, how much you’ve spent per click as well as a number of other important metrics for identifying how well those ads are Performing.

That’s all well and good, but what LinkedIn’s Campaign Planner doesn’t tell you is whether or not those clicks are converting once they arrive at your website.

This is where conversion tracking comes in.

First of all, open up LinkedIn Campaign Manager and navigate to ‘Conversion Tracking’ in the top right-hand corner.

Screen Shot 2018-02-26 at 15.38.47

If this is the first time you’re accessing LinkedIn’s conversion tracking you will first have to enter the domain you wish to set tracking up for.

Screen Shot 2018-02-26 at 15.39.32

You will then be presented with the following screen, asking you to install the insight tag.

Screen Shot 2018-02-26 at 15.41.10

However for the purposes of this guide, we'll come back to this and instead click 'Next' to progress to step two, where you create your first conversion.

Screen Shot 2018-02-26 at 15.42.06

You now have to define the new conversion you wish to track. This includes:

  • the name of the conversion;
  • the conversion type (which can be changed via the dropdown);
  • the conversion’s value, for example how much you’re willing to pay for a lead or other conversion type;
  • the domain of the website; and
  • the URL of the destination page (either ‘Exact’ or ‘Starts with’) where you want to count a visit as a conversion event. This might be a thank you page following a form fill or a download such as www.example.com/form-thank-you.

Once you’ve set up this conversion, let's add that LinkedIn tracking pixel to your website. First, open up your GTM dashboard and select ‘Add a New Tag’.

Screen Shot 2018-02-26 at 15.44.57

Give your new tag a name, and then select ‘Tag Configuration’.

Screen Shot 2018-02-26 at 15.45.41

Now, select the ‘LinkedIn Insight’ tag type from the list. You can find it using the search function in the top right-hand corner.

Screen Shot 2018-02-26 at 15.46.52

When you select the ‘LinkedIn Insight’ tag you’ll need to input the ‘Partner ID’. This is what identifies your LinkedIn account to GTM. To find it, switch back to LinkedIn Campaign Manager and click ‘View insight tag’ in the right-hand corner of the conversion tracking page.

Screen Shot 2018-02-26 at 15.48.13

You will then be presented with the insights tag that we saw earlier. Without GTM you would need to copy and paste it onto every page you wished to fire the trigger on. However for our purposes we only need to extract the partner ID:

Screen Shot 2018-02-26 at 15.49.17

Copy this ID and paste it into the relevant field.

You now need to set up the trigger for this particular tag.

After you’ve clicked on the ‘Triggering’ box you’ll have the choice between selecting from the list of your previously made triggers and creating a new one. Let’s assume you want to create a new trigger for this tag. First, click on the plus icon in the top right-hand corner and then click on ‘Trigger Configuration’.

Now, choose your trigger type from the list.

Screen Shot 2018-02-26 at 15.50.49

For this example, let’s choose ‘Page View’ as our trigger.

You can now choose between the trigger firing on all page views or only some of them. If you choose to only fire the trigger on some page views, you can define the conditions based on these variables:

Screen Shot 2018-02-26 at 15.52.33

Finally, save the trigger and then the tag. This will add the new tag onto your website.

To test that the tag has been applied, click ‘Preview’ in the GTM dashboard. This will enable preview mode.

In a new tab, navigate to the website you’ve set the tag up on and at the bottom of the screen there should be a pane that shows which tags are firing.

Screen Shot 2018-02-26 at 15.54.01

You should see the name of your new tag in this pane. If it’s not appearing, go back over this article and make sure you’ve set up the tag and trigger correctly.

That should be it. Unfortunately, LinkedIn doesn’t have the ability to filter our conversions by IP address yet so you don’t get internal traffic, so try not to visit your ‘thank you’ URL more than once as a test.

"Klood are passionate about HubSpot and this shows in their support work for the software which is creative and shows great expertise.

They always go the extra mile in trying to solve problems and remained resolutely cheerful and positive through what was a challenging integration with our existing set-up. I'd definitely recommend their services."

Sam Clarke, Experience Travel Group

Sam Clarke Experience Travel Group

"Klood Digital have given our marketing a new lease of life, transforming our old fashioned methods of driving new traffic and generating new leads with a much more informed and strategic approach.

I highly recommend Klood for those organisations who are looking for a fully integrated HubSpot agency who are inbound specialists and can support with the overall strategy."

Shawn Bristow

Emma Murray Palmer Capital

Get in touch

If you’d like to discuss how Klood can help you build your inbound strategy, then fill in the form