Unlocking the power of Google Tag Manager
Top tips on getting the best from Google's tag management system.
Learn what Google Tag Manager is and why it's more than the go-to platform for managing your data collection. Use this guide to help you manage multiple tracking codes and snippets seamlessly without involving developers.
Google Tag Manager empowers marketers to efficiently and accurately measure their website's performance, enabling them to make data-driven decisions and optimise the user experience for their customers.
Sam Dunkley, Senior Web Analyst
What is Google Tag Manager (GTM)?
It's a free tag management system created by Google which allows website owners and marketers to add and manage marketing and analytics tags without the need for a developer.
What is a tag management system?
A tag management system (TMS) is a platform that easily facilitates deploying and managing tags (scripts or code) to your website. Tags are used for Google Analytics, Facebook Pixel, AdWords Conversion Tracking, and others.
What is a tag?
A tag is a snippet of code executed on a page or mobile app.
GTM tags collect data from your website or app and send it to a third-party system, but they are not limited to this. That said, tags that collect data from a website or app and pass it into a third-party system are the most common.
Aside from website tracking, in GTM, you can use custom HTML tags to:
- Style a website
- Make changes to a website layout
- Deploy cookie consent banners
With the freedom of Custom HTML tags, the possibilities are huge. You can use these tags in the following instances:
- Setting new first-party cookies
- Storing data in browser storage
- Deploying CRO testing tools
It's this freedom and flexibility that makes Google Tag Manager so powerful.
Did you know?
Tags in the digital marketing and analytics context are similar to, but distinct from, the standard HTML tags that developers will use to code web pages. The analytics version of the word "tag" is derived from the fact that the tags provided by vendors are often encapsulated by HTML <script> or <img> tags.
The GTM hierarchy
A quick refresher on the GTM structure
- At the head, you have a GTM account.
- A GTM account doesn't deploy or hold any code.
- Instead, it acts like a folder where you can collect and organise your GTM containers.
- Then you have your GTM containers
- These are where your tags are set up and the code is deployed.
- You can have multiple containers active simultaneously, and it's worth noting there are different versions for app and web.
- The final level in GTM is workspaces and versions.
- GTM workspaces exist alongside the live version and don't affect what's happening on the website.
- This is where you can draft changes and test them before rolling them out to the website.
- Once you publish a workspace, it will become the live version, and your old version is stored, which you can refer to later if required.
Why is GTM the go-to platform for data collection?
The following make GTM the go-to tag management system and are the principal reasons why so many people and organisations use the platform.
- The GTM platform is FREE.
- Marketers can deploy or update tags with agility and speed.
- No developer resource or coding knowledge is required.
- Google Tag Template - this does all the heavy lifting for you when configuring the code required to collect data, making it a breeze to focus on the required field.
- There is a great community.
- There are many resources and helpful people who are there to support you.
2. Harnessing the power of GTM to bring data collection under your control
How GTM can make your life easier
Summing it up in one line, it brings tag management into a single platform, with (most of the time) a single process to roll out a new tag.
It's the ease of use that makes it a marketer's dream, along with the following features:
- Effective tag management with all tags kept in one place.
- It means it's straightforward to find out what you're tracking and what you're not to avoid any duplication of effort.
- There are workspaces for collaborative or independent working
- Deploy or update tags simultaneously with three completely separate workspaces available
- The platform allows you to be confident in your set-up, even in the early stages of becoming a tag manager expert.
- It's got a built-in testing tool, which is now integrated with GA4, to let you be confident in your tags.
- There is version control!
- So if you spot errors on the live site, you can immediately view and roll back to an older (working) version of GTM while you investigate the issue with the current one.
- There is simple control over user permissions.
- This feature makes it easy to control who has access, which is crucial.
- And one more thing, when it comes to why it is so popular.
- The community and resources available are vast, with answers to all common questions, which lets you be self-reliant when problem-solving. You can get help easily and quickly when you're stuck.
The alternative to Google Tag Manager is that each time you want to deploy or update a tag on the website (even if this is just a minor tweak, like a change to your GA event naming convention), you'd need to request development time.
This process requires updating the website's code directly to implement the necessary changes. This method is far more time and labour-intensive.
The key to getting started with GTM is….
Just getting started… There are no prerequisites to creating and configuring GTM.
We've established how GTM can make your life easier, so what is the best way to get started? The best step you can take is to dive in and get started. You don't need to prep or do anything to start or increase your learning.
Start by Googling 'Google Tag Manager' to commence your journey.
If you have a Google user profile, you can create your Google Tag Manager account and then your Google Tag Manager container.
The great thing with GTM is you don't even need to get the developers involved if you want to try things out.
There are some great 3rd party tools out there which let you 'inject' a GTM container onto your site.
This means you can see how your test GTM container works on your websites, only on your browser, without any effect on your website for any other user, no matter what.
And you don't need to get the developers to add in the GTM script.
It means you can start unlocking what it can do for you with zero cost (other than your time) and zero risk.
To get started, all you need to do:
- Sign into your Google profile
- Create your Google Tag Manager account
- Create your Google Tag Manager container
You don’t even need the GTM script installed to start!
To avoid needing the developers to add the GTM script, there are third-party tools called GTM ‘injectors’. These can add your GTM container to your site only for your browsers. It lets you test your container and configuration before committing to installing the GTM script.
There's a debug view
You can preview a site where your GTM container is implemented as if the current workspace was already live.
The GTM debug view (also commonly called the GTM preview mode) is GTM's built-in testing tool.
It loads the changes you've made in the GTM workspace onto the live site, but only for your browser.
The debug interface shows detailed information about your tags, including how tags fire and what data has been processed.
Use the information in the debug interface to find out if tags and triggers fire correctly and what data they pass to their respective platforms.
It will show you each website interaction it's listening out for, for example, every page load and every click and tell you what tags fired, what tags didn't fire and, most importantly, why.
So you can use this tool and lean on it, to be confident in your changes or build up your confidence in using the platform.
Use debugging to:
- Ensure your tags are working perfectly
- You can ensure the tags are triggering when they should and that the variables and data passed through in the tags are pulling through the correct values.
- Before you push anything live
- You can use it to ensure you're happy with how GTM works and go through some trial runs before committing to the platform and implementing the GTM script.
Important!
If a team member who is the sole administrator of your Tag Manager account changes roles, you can get locked out of Google Tag Manager.
3. Unlocking the power of Google Tag Manager
1. GTM governance
Effectively using Google Tag Manager, especially in the long term, starts with strong GTM governance.
Managing a GTM container is as much a skill as being able to create accurate tracking inside it, for example:
- Remain in control
- Plan ahead and ensure that there are always at least two active administrators on each account.
- User Permissions
- GTM has the potential to negatively affect website performance through excessive tags, or directly changing functionality
- As such, user permissions need careful management.
- Ensure ex-colleagues or previous agencies have access removed or, at least, have the appropriate access levels for their role or organisation.
User permissions
- Publish - create versions, workspaces, make changes, and publish.
- Approve - make changes and versions but not publish
- Edit - make changes but not versions or publish
- Read - see the container, but not make changes
Naming conventions
- A consistent naming conventionfor tags, triggers, and variables makes GTM quicker and easier to use.
- This translates, to easier onboarding for new team members, faster tag deployment and less risk of tag duplication.
Delete redundant tags
-
Too many tags can pollute theGTM container, and negatively affect site speed. Delete redundant tags to clean up GTM.
-
A common culprit is marketing tags. Campaigns oftenrun for short periods. Be fluid in creating tags but organised in removing them when the campaign is finished.
2. RegEx
RegEx (regular expressions) is a character sequence specifying a search pattern text.
RegEx expressions can be heavily used in Google Tag Manager to reduce the number of triggers you need to build for a single tag.
Description | RegEx statement |
Or statement | | |
Any character | . |
Wildcard | * |
Ignore case | ¡ |
RegEx flexibility
It’s a flexible way where marketers can use a single statement to match all elements, certain elements or even multiple elements in a string.
An example of where it is useful is in OR statements.
- One thing not easily achievable is OR statements in triggers.
- For example, fire on this page OR this page
- RegEx can save time and simplify the need to use multiple triggers on a single tag to achieve this.
- And it does so through simple statements, in this case, just the pipe symbol.
Other languages that come in useful include:
- CSS selectors - allow you to build triggers and variables of the more complex aspects of a website by targeting HTML elements and attributes way beyond what the built-in GTM variables will enable you to do.
- JavaScript - lets you build out custom JavaScript variables. These are often used to format, look up, or manipulate values before they’re sent through in tags. Like custom HTML tags, where you have free use of a language like Javascript, the possibilities and use cases are enormous.
Top Tip!
RegEx has many uses outside of GTM, so you’ll come across and benefit from knowing the language far beyond tag management.
3. The dataLayer
The dataLayer is a JavaScript object that is used to pass information from your website to your Tag Manager container.
The dataLayer is a JavaScript object that we use to pass information from your website to your Tag Manager container.
What does the dataLayer do?
We use the dataLayer to build rigorous tracking foundations and provide additional insights by unlocking new data from your website, otherwise unavailable with the standard GTM capabilities.
When visualizing, consider it a layer of virtual information above your website that Google Tag Manager can use. Not only this, but we can use it to trigger GTM tags at the perfect time.
So how does the dataLayer get populated?
Technically, GTM already uses the dataLayer. For example, the built-in triggers, like click events and page loads, are dataLayer events. The default GTM script makes these.
But, to get custom dataLayer events to fire and dataLayer variables to populate, these are implemented on request by the developers and coded into the site.
A little white lie
Hands-up, we told a white lie. We said one of the big benefits of GTM is not relying on the developers to deploy tags. But in this case, with the dataLayer, it's a necessary step.
Firstly, a dataLayer request means only one code change is required, and you can forward the information surfaced in the dataLayer, using GTM, to different platforms. You don't need a dev request per platform, e.g. a request for GA, one for Meta, and one for Google Ads etc.
Importantly, using a dataLayer means you can collect more data and trigger more complex events than you'd be otherwise able to with a standard configuration of GTM.
An eCommerce website provides a great example of this. Product SKUs, categories or stock levels can be taken from the backend, presented in the dataLayer and then sent to Google Analytics.
Another use case example is user information.
You can surface an anonymous ID associated with a user's login. You can use this GA to map sessions accurately back together to the same user, despite being on different browsers or devices (a great feature of GA4).
It also means robust rigorous tracking. The dataLayer is far less likely to break during essential site updates and can even be carried across to your new website if you were to ever re-platform, which will drastically decrease the amount of Google Tag Manager migration work required.
Google Analytics recommendations
Our top three custom dimensions for Universal Analytics and Google Analytics 4 to configure in GTM.
- GTM tag name
- GTM container ID
- GTM container version
Google Analytics is one of the most common uses of GTM.
Creating these custom dimensions will make debugging any issues with your GA data, which must be traced back to the GTM container, vastly easier.
It will provide a vital link between your GA data and your GTM set-up and save a lot of time in the future when trying to re-map the two together
In summary
Google Tag Manager (GTM) is the go-to tag management tool that provides website owners with an easy and efficient way to manage and deploy tracking tags on their websites. Overall, GTM helps marketers improve the efficiency and effectiveness of their tracking and measurement setup, ultimately leading to better business outcomes.
We can support you with your data collection and reporting needs; call us on 01903 285900, send us a quick message or use the form below.
Watch our bitesize learning session on unlocking the power of Google Tag Manager
Loading
Can we help you create brilliant Looker Studio dashboards?
Tell us your needs and we'll be in touch
Google Tag Manager FAQ
We are migrating UA to GA4, and our UA container is such a mess that we would like to start again with a new GTM container only for GA4 and the marketing tags we currently use. What are the risks of having two GTM containers, and is there a better / different way of managing this?
The recommendation, on the surface, is to keep to the one GTM container. Instead of starting from scratch, work through the old set-up and fix the project. It must be stressed this is always a case-by-case assessment.
My site structure is complicated. Is there any way I can set it up so that it works across domains and different access levels?
This question is one where the answer would be ‘it depends’. GTM containers can be flexible, and the best set-up depends on your site structure and how you want to use the GTM container. Spreading out the container and using multiple containers will give you more control of user access to different website sections. But it might result in tags repeating in multiple containers, where you must replicate updates numerous times.
I've heard GTM can slow down websites. Is this true?
Yes, but don't panic about it. Any script or new functionality on the site will increase page load speed. However, the GTM script is not a significant factor in this. The real issues come when hundreds of tags are in the GTM container, with a host all trying to fire on the page load. You can avoid this problem. GTM governance is the way forward, keep to defined processes and regular maintenance, and you won't run into significant issues.
My marketing agencies keep asking me for GTM access - is there anything I need to be aware of when granting access?
We know GTM is an excellent tool, but there is always the possibility of things needing to be corrected, especially if you grant access to third parties. Make sure:
- You only give appropriate levels of access.
- Avoid giving publish access where possible.
- Nominate a GTM lead or team to take responsibility for QA’ing all tags, ensuring they’re up to governance, and setting them live.
Are there any tools available for injecting a GTM container onto a page?
Yes, many third-party tools allow you to inject a GTM container onto a page.
Our recommendation is AdSwerve dataLayer inspector.
You can also use the tool for debugging. It is available as a Chrome plugin.
Is there a quick way to identify redundant tags?
Unfortunately no. The best solution we utilise in identifying redundant GA tags is using custom dimensions. Setting up custom dimensions for GTM Tag Name, GTM Container ID, and GTM Version will let you see in GA which of those GA tags have fired recently and which haven't.
What is the best practice for loading the GTM script? On one of my websites, it is loading after 10sec.
Add the GTM <script> code as high in the <head> of the page as possible.
One reason we want the script to load as quickly as possible is so tags which fire when the page loads track as accurately as possible.
What is ssGTM?
Server-Side Google Tag Manager is a way to take some of the processing around executing tags away from the user's browser and onto a server to increase website performance.
Can you pull product information in through GTM rather than load it directly onto the site for eCommerce?
Using the dataLayer, you can load product information into it, surfacing it for GTM. It's a way to pass additional product information into GTM and then, other platforms.
What is the best practice (and first steps) for reviewing GTM from a prior team member it and the first steps?
We recommend auditing the GTM container.
The best and most effective way is to individually check each tag in the GTM container. This way, you can ensure you're happy with the container's configuration and check that each tag is triggering correctly.
Suppose you delete a tag and want it back later on. Can you find it again? Is there an archived folder? Or do you have to rebuild it?
A GTM container stores old versions that you have set live.
You can view all tags previously in a live container and the configuration by clicking the 'Versions' tab in the top left of the navigation.