Google Tag Manager (GTM) can be difficult to master, especially if you are managing a large website or if you are working as part of a team. Understanding if what you’re doing is actually the right thing to do can be also frustrating, but with the following tips, we hope you can hone your skills and get better at using this fantastic tool.
Let’s have a look at them:
Let’s have a look at them:
Use workspaces as your own sandbox
Create a new workspace every time you need to implement new components and treat it as your own development environment. It is best practice to avoid using the default workspace, especially if working in a large team. The default container is useful for some quick testing of the most up to date version of your project, but not for creating new tags or triggers.
Use RegEx tables
Regular expressions, a.k.a. RegEx, are a series of characters that allows you to create patterns that help match, locate, and manage text. GTM offers a very helpful variable called RegEx table that takes another variable as input and if it matches a pattern, it returns a much better formatted text that, for example, can be used in your Google Analytics events by providing much neater data. There are many online tools for regex such as regex101.com that allows you to test and find patterns that work for you. An example will be this expression ^a...s$ which means it will match any strings that starts with ‘a’, finishes in ‘s’ and has a total of five characters. So, that will match text like ‘alias’ or ‘abyss’ but won’t match ‘abs’, be aware that it is case sensitive.
Avoid using constant variables instead of Google Analytics (GA) settings variables
Using a constant variable instead of overwriting GA settings is not a bad practice per se, as it allows you to quickly manage different GA accounts, but you are missing out on many other functionalities. Using a GA settings variable provides you with more data to be used consistently across many GA tags and ultimately, saves you time!
Regularly audit your container
Looking for unused tags, triggers and variables is one of the many tasks you should tick off your Google Tag Manager audit checklist and it should be performed regularly. Thanks to Taggernauta, you can do just that in an automated fashion, which speeds up your audit massively.
Use folders to categorise your tags
Using folders in GTM is a lifesaver when your container has grown quickly. Useful examples can be to create folders for third party vendors or different parts of your website.
Use vendor specific templates and avoid using HTML
Whenever you can, it is better to use a tag coming from an existing template for third party vendors rather than using HTML tags. That is primarily because they provide a better understanding of what information is leaving your business and they are less likely to include corrupted code.
Check HTML tags before publishing
Set a default value in Lookup and RegEx tables to avoid ‘(not set)’
When working with these types of variables it is necessary not to forget to tick the checkbox ‘Set Default Value’ and assign either a variable or text of your choice. That small tweak will make your data cleaner and easier to use as you will avoid ‘(not set)’ or empty parameters in your reports.
Use good and consistent naming convention in GA event tags
This is as straightforward as it sounds, but often overlooked. Especially when working in a team, it can be hard to maintain consistency across your set up. Decide what makes sense for your team and for your business and decide on a universal naming convention that will massively help you in the long term.
Check if events are pulling through in GA correctly
Testing, testing and testing are key here. Make sure tags are firing correctly and sending the right information. Taggernauta is currently developing a new feature that will allow you to automatically check if tags are firing or not and be alerted if they are not collecting any info. Stay tuned!
What are your top tips for GTM?
This blog post described just 10 ways to improve how you manage your GTM containers and implementation, but there will surely be more! Let us know your thoughts about the new development pieces in the pipeline or any questions you might have – we will be glad to help. If you want to know more about Taggernauta or want a free demo, contact us.