Google Tag Manager (GTM) is a powerful tool that, in common with a lot of other Google products, does exactly what its name implies: it manages tags. In this case, ‘tags’ refers to codes and code fragments that enable analysis and measurement of your traffic and users.
In some respects, Tag Manager does for tags what Ad Manager does for ad demand sources; it organizes tags from Google Ads, Google Analytics and 3rd party sources into a collection of tags called a container in order to streamline your site. From within Tag Manager, you can organize your tags, set up triggers (that cause the tag to count and/or perform an action when an event occurs), and create variables to make tag design simpler.
But what are the best things to do once you’ve decided to utilize the power of GTM? Here we’ve put together a few best practices to help you succeed.
This is actually a piece of advice that covers all Google products, especially in the ad space. Even if you’re going to be the only person on the account, make sure you set up recovery passwords and know what to do in the event you lose access to your account. If you’re part of a team, establish who will have access, and what will happen in the event someone leaves the team. Separating a product like GTM is generally a good idea, i.e. creating a dedicated Google account that deals with GTM. This limits security issues from users having access to other Google products under the same account.
What are the objectives of the business or web site? What information are you hoping to extract from your tags, and reports they generate, and how will they achieve the objectives of your site? Blindly creating tags without a structure or clear direction will lead to over-complication, and it will be harder to analyse what you’ve done. This might take the form of a workthrough of a typical customer visit to the site; what interactions could they have? Where does an event trigger need to be placed? Diagrams and flowcharts can be helpful as well.
A GTM account is made up of containers. An account with one website might have only one container, whereas a more complicated set of domains might have many. A container contains the Java code that must be placed in the source code. Google’s suggested best practice is one container per site/domain unless a user’s experience could flow on to other domains within the same visit. For example, if you’re running a sports news site and a sports results site where the user could move back and forth between the sites, one container might be appropriate.
Even if the site or your intended use for GTM is fairly simple, a robust naming convention is advisable. This is true for almost anything related to programming, site design, and even files saved on your computer, so it’s a good habit to get into, and you may already do it automatically. With GTM and the number of tags and events that can build up, it’s very important to make the names logical to prevent errors and confusion.
GTM allows you to do things like set up constants, lookup tables, and custom templates. Constants are useful to set things like account IDs or property codes once and apply them to every tag, with the advantage that if they change in the future they would only need to be changed once in the constant. Lookup tables allow you to map multiple input values to output variables without creating separate tags, cutting down on complexity and workload. Custom templates are useful even for accomplished coders as a time-saver.
Another important function is the Data Layer. It’s not a simple concept to explain as it’s not visible on the site, but it is a place to temporarily store data generated by user interactions with the site that GTM can access and consequently fire/record/trigger events. Custom templates can add data to the data layer, or even 3rd party plugins.
It can get very complicated very quickly, so our advice is not to try and learn it all at once; formulate a plan as mentioned in point 2 and work out what you need to accomplish that plan. If you’re not familiar with a technique that is necessary to achieve your goal, you can research it and the fact that you have an active use case should help with understanding.
After you implemented tags, make sure that they are doing what they are supposed to. Are events being recorded correctly? Does the site still function as it should? Tag Managers do use scripts that will run on a page, so a badly implemented tag setup could have an impact on site performance. You could also consider implementing your new tags on a test site first in order to run speed tests. GTM also has a preview mode where you can test that your tags are performing as they should.
Need help optimizing your ad speed, layouts, performance, and more? MonetizeMore is a Google Certified Publisher Partner already helping hundreds of publishers reach their full ad revenue potential. Let us do the same for you!