A beginner’s guide to Google Tag Manager

5 minute read

Share:

The more relevant your website becomes, the poorer it is likely to perform. This might sound counter-intuitive but, as your website develops and grows, you add more and more third party tags and tracking. These will start to slow your website down, reducing its performance.

To avoid this, you need to keep on top of your tags and manage them efficiently. Traditionally, the deployment and management of tags was done through webmasters, developers and IT departments. Thankfully, Google has now introduced the Google Tag Manager (GTM) to allow marketers to do it themselves.

In today’s article we’ll look at:

  • What a tag is 
  • Why you should use Google Tag Manager 
  • A step-by-step guide from setting up a account to setting up your tags 
  • Top tips for using Google Tag Manager 

What is a tag?

A tag is a piece of tracking code used to collect measurement and marketing data from your site and send it to a third party service such as AdWords, Google Analytics, Facebook, Twitter and many others.

You may have already deployed a Google Analytics Tracking Code into your website to allow you to track and analyse insights into your site traffic, activity, and conversions. The tracking code is a tag which now can be implemented via the Google Tag Manager tool.

Why use Google Tag Manager?

Firstly, it’s worth mentioning that there are several tag managers out there, but Google’s version is arguably the most authoritative and intuitive. It’s also completely free, and integrates nicely with the rest of your Google account, including AdWords and Analytics. There’s also a free plug-in for WordPress.

While it’s possible to bypass GTM altogether and implement tags directly into the source code of your website, GTM offers you a host of benefits to make the process a lot easier:

  • You can determine when and where the tag should be deployed and what the tag should do when it’s deployed
  • You can easily add, remove, enable and disable tags
  • You can quickly undo tags and revert to previous versions
  • You can benefit from advanced tag management
  • You can increase your website speed

As a local business, it’s most likely you’ll be using GTM to set up and manage tracking on your Analytics and AdWords without needing to get too technical and/or call in help from your developer or IT department.

Step-by-step guide

1. Set up a Google Tag Manager account

Go to https://tagmanager.google.com and add a new account.

Enter the name of your company as the account name. Then, add your URL to “setup container”. Your container is the domain you’re looking to manage. “Where to Use Container” is most likely to be “web” unless you’re registering an App.


Your workspace (dashboard) should look like this:

2. Place the code in your website

There are a couple of ways to input the code into your site.

a. Manually
When you set up your Tag Manager account, the following pop-up should have appeared:


If not, then the same piece of code can be found under Admin and Install Google Tag Manager.

Copy this code and paste it into the <head> of each page of your website.

b. Use a plug-in
A much easier option is to install a plug-in within your CMS. WordPress has a free GTM Plugin to guide you through the process of installing and managing tags/code via your WordPress CMS.

3. The anatomy of your Google Tag Manager workspace

GTM is extremely intuitive and easy to use but it’s worth introducing you to some of its features before we set up tags.

a. Accounts
Your account refers to yourcompany. Typically, one business needs only one GTM account. However, should you need to create more accounts, you simply click on “create account”, under the Tag Manager homepage:

b. Containers
The container should share the same name as the website the tag manager is covering, in this case www.charlottejenkins.co.uk. The container then holds all the tags for this domain. If your business owns more than one domain, you can add more containers by going to admin, container and create container.

c. Tags
Now you’ve set up your account and container, you can begin creating your tags for your container. GTM provides template tags to simplify this process, or you can customise your own.

Once you’ve created your tags (see next section) they can be found in “folders” in the left hand menu in your workspace.

Terminology used for setting up tags:

  • Category (Required): what you want to track, e.g. links
  • Action (Required): the type of interaction, e.g. clicking on a link
  • Label (Optional): a summary of the event, e.g. click on an internal link
  • Value (Optional): assigning  a numeric value to your tag
  • The True/False field is used for a non-interaction event. If you want your event action not to create a new page view and not to impact on the bounce-rate, then set this value to True.
  • Google Analytics Settings (optional/required): input your Universal Analytics tracking code, which you’ll find in your Google Analytics account (it will begin with UA – )

d. Triggers
When adding a tag, you need to determine under which conditions you’d like it to “fire”. For example, you may have set up a tag to track internal links throughout your website. However, you may want to set up your triggers to track this tag on certain pages or at certain times. Your trigger tab allows you to do this using predefined (built-in) triggers, or you can custom your own (user-defined).

e. Variables
Variables are functions within GTM called upon by the tags and triggers. They tell the tag where to fire and can be:

  • Built-in variables (templates supplied by GTM)
  • User-defined (custom-built by user)

f. Versions
One of the qualities of GTM is that it saves all the versions of the tags and triggers you’ve set up. These can then be viewed and reverted to at any point in the “versions” tab. See it as a big “undo” or “redo” button.

4. Setting up your tags

Example 1: Setting up tracking on your contact form submissions

a. Add your tag
Go to “add tag” and choose Universal Analytics (preferable to Classic Google Analytics) from the custom tag types provided. Name your tag “Contact Form Submissions”.

Input the detail of the tag:

  • Type: Event
  • Category: New lead (the person submitting a contact form)
  • Action: Page path (which page the contact form was submitted from)
  • Label: Contact form submission (FYI)
  • Non-interaction Hit: True (avoid interference with bounce rate)
  • Google Analytics code: Input your UA- code.

b. Set your triggers
Go to add triggers, “+”, and choose trigger type “Form Submissions”.

Choose whether you want to track “all forms” or “some forms”; the latter allows you to identify which page your target contact form exists on:

In advanced settings, you can customise your firing schedule and choose your tag firing options e.g. “once per event”, “once per page”, or “unlimited”. You can also determine when the tag fires: in this case before the contact form submission fires or afterwards.

c. Publish your tag and triggers
Make sure you name the version you’re about to publish with some descriptive text. This will help if you need to revert to a previous version.

Example 2: Tracking external (outbound) links
If you want to track your website’s external links and see how often you’re sending traffic to other websites, these can be tagged in GTM.

a. Set up your variables
Go to the “variables” tab of Tag Manager, and create a “user-defined” variable called “Click URL Hostname“. This will help identify the external link when we’re setting up the tag.

1. Variable Type: Auto Event Variable
2. Variable Type: Element URL
3. Component Type: Hostname
4. Strip www.

b. Set up triggers

Go to triggers section and add a trigger “outbound links”.

1. Trigger Type: Just Links
2. Wait for Tags: 2000ms
3. Check Validation
4. Page URL: matches RegEx:
5. Trigger Fires on: Some Click
6. Click URL Hostname: does not contain yourdomain.com

c. Save and publish

Top tips for using GTM

  • Ask Google: If you’re unsure of how to set up certain tags and triggers, use Google to find out. Someone is certain to have written a blog post to guide you through it. After all, some tags are trickier than others to set up and you won’t be the first person to have trouble.
  • Test before you go live: Use Google Tag Manager Preview and Debug mode.
  • Set up your tags one at a time: Don’t go overboard to start with or you risk getting in a muddle. Once you’ve added a tag, check it’s working and giving you the right information using Google Analytics Real-Time before you add the next.

Share:

Charlotte Jenkins is an Oxford-based content marketer. She has several years’ experience in content writing, editing and digital marketing, helping clients communicate their businesses online.

Sign up to the UK Domain newsletter

Get all our monthly news and updates direct to your inbox