Categorized as StartUp

A Complete Guide to Google Tag Manager

Google Tag Manager Guides
by Andre Oentoro Originally published   ·  Updated 

Google tags are bits of code that businesses embed on their web pages to gather insights about them. These tags, when deployed, provide admins with metrics such as visit duration, links clicked, section time, products your customers liked, and more. 

Even though tagging is important, doing this process manually can take a lot of time and effort. That’s why most businesses use tagging tools such as Google Tag Manager (GTM), a tag management tool that creates and manages the different tags required to monitor the website. 

Google Tag Manager allows businesses to collect their user data and optimize their digital strategy. Through GTM, you can freely create and add Google tags to your webpage without modifying your underlying code since the tags created by this tool can be directly embedded into your website.

Adding tags through this tool reduces errors and increases the efficiency of the whole process. 

All the Google tags associated with your website can be monitored through the GTM dashboard. It allows users to efficiently control and track their tags. You can also use filters such as size, resolutions, and connections to generate insights about your tags.

Along with website tags, GTM also allows you to create and monitor tags for Android, iOS, and AMP applications.  

Why should a business implement a tag management tool at an enterprise level? 

Google Tag Manager is one of the most popular tag-management tools in the market. It has steadily generated huge profits and is considered highly trustworthy by many organizations worldwide. Here are some of the main benefits that have led to its popularity.

1. Free and easy to use

Google Tag Manager is an easy-to-use tool that doesn’t require a lot of coding skills. Even novice admins can easily create and deploy tags without affecting production code. They don’t need to create support requests for the website development team. 

Google Tag Manager can be easily integrated with Google Analytics to study customer data. It’s also free to use, and companies can access it through their Gmail account

2. Single point of contact 

Google Tag Manager allows users to manage all their tags from a single interface. This improves productivity and reduces skill-based lapses. 

Google Tag Manager also maintains a version history through which you can revert to previous versions of your code if required. This is highly useful if your code breaks and you need to quickly revert your production environment to the last working stage. 

3. Ease of tag creation 

It has a wide range of built-in tag templates that allow you to create custom tags for your tracking requirements. You can also make your template and use it to create tags for your project. If you need help, you can always get in touch with an experienced IT outsourcing partner for support and collaboration.   

4. Malware detection 

This added layer of security in GTM automatically scans all scripts, tags, and containers for malware. If it finds (or suspects) any malware, it raises a flag in the system for developers to check. 

How do you set up a Google Tag Manager account for your website? 

Setting up Google tags for your website is quick and easy. Here is some simple steps website admins can follow to set up their account and create their first tag. 

  1. First, use your email address to create and login into your Google Tag Manager account
  2. Click the Create Account button, which prompts you to fill in information such as business name, website URL, etc. 
  3. Once you have filled in all the details, click Create. It will display the Terms of Service page and prompt you to Accept. 
  4. The next page will display your snippet code, i.e., the tag you need to add to your website for generating analytics. It will also contain coding instructions for how to add tags to your HTML page. You can embed your code in the head tag or body tag. 
  5. Once you have added the head and the body tags, you are ready to use your Google Tag Manager. 

This simple process can be used to create and deploy all kinds of Google tags for tasks such as analytics, conversion tracking, and remarketing. For optimal performance, try to add only one tag per page. Of course, you can always use the config parameter to add additional products to your tag.  

Tags created through GTM are different from third-party integration tags (syntax-wise). Even though custom tags are allowed, Google advises you to create tags only from their tag management tool. 

User and User Permissions  

Your GTM account also has options to set up different kinds of users. Once you click on the Users tab, you’ll get a list of active users, differentiated by their email addresses. You can use this tab to add new users and change/update permissions for the existing ones.

Once created, these users will be able to access your containers. They can then use them to create and deploy tags. For security purposes, you can specify certain permissions on the container level. The View, Edit, and Manage option present under User Permissions allows you to specify these parameters. 

There are different types of container-level permissions under which new users can be classified:  

  • No Access – The user cannot see or access a container.  
  • View Only – The user can see the container and the tags associated with it but cannot update it.   
  • View and Edit – The user can view, edit, and delete tags available in the container. They can also publish these settings in live environments. 

Triggers, Macros, and Variables 

Apart from tags, you can also use GTM to create variables and triggers. Rules /triggers are pieces of code that respond to a specific event. They listen to your website, and if they encounter a specific event, they follow their instructions (fire a tag).

Admins use macros to identify trigger mapping. Macros compare the collected information to existing information at runtime to see if any value has changed. The system uses this information to determine whether a trigger fire is required or not.  

Variables help users define filters for tag firings. They can be used to set off a trigger, which in turn fires the tags associated with it. They can also be used to capture dynamic values for tags. 

You can use the option User-Defined Variables to create new variables for your existing tags. Click on New and add details such as name, variable type, and tag. The tag type field is used to identify the property that you want to track. If required, you can also add triggers for your tags. 

Extensions for Google Tag Manager

Even though GTM is a very versatile tool, it cannot do everything. Fortunately, there are many tools available online to bridge that gap. These tools are called GTM extensions, and admins can use these tools to improve performance and make implementations easier. Here are some of the most popular GTM extensions on the market. 

1. DataSlayer

This GTM extension is highly useful for testing and debugging tag implementations. 

It can monitor multiple data layers/containers on a single page and is a handy tool to debug tags, variables, and click events. You can also enable and disable flags if you work in a development environment. 

Along with GTM, you can also use this extension with other tag management tools such as Tealium, Adobe Launch, and Adobe DTM for Adobe analytics.

2. Tag Assistant

This browser-based extension is an amazing tag debugging tool. Once you add it to your browser and click the debugger option, it will open a new debugging window for your current page. 

One significant advantage of this tool is that you can debug multiple windows. It also has options for mobile and iframe debugging.

3. SandoGTM 

This GTM extension uses shortcuts to search, edit, and debug custom tags. In addition, this is one of the few extensions that let you delete multiple tags simultaneously. 

This tool also allows you to customize your debugging environment. For example, you can change the color/size of tag preview notifications, hide default variables, and edit sheets. It also has options for GTM test look-up and regex tables. 

4. Redirect Path 

This extension is highly beneficial for checking the redirected URLs present on your webpage. Through this, admins can check meta and javascript redirects and use them to verify HTTP headers, server IP addresses, and channel logs. It also allows developers to debug failure codes such as 500, 301, 302, and 404. 

Furthermore, this tool’s newest version can also detect under-the-hood logic changes and notify end users about the impact of link redirection. It can also check if a link is secure or not (HTTP vs. HTTPS) for cross-domain link tracking.

5. Datalayer checker

This browser-based extension allows you to check data layer components such as coloring rules, JSON views, etc. This tool is highly customizable and can be configured for different GTM containers. You can also use its console logs for debugging tags.  

6. Facebook/Twitter Pixel Helpers 

Pixel helpers are troubleshooting tools through which users can validate pixel implementation for their websites. Through these extensions, users can track conversions and manage leads to different websites such as Facebook and Twitter.

When clicked, they open a display panel that provides real-time feedback for metrics such as the number of tags fired, which websites are affected, and implementation issues. Facebook Pixel Helper tracks the Facebook pixel tags, and Twitter Pixel Helper tracks the Twitter universal website tags.  

Risks to Avoid While Using Google Tag Manager 

Google tags are highly effective tools for optimizing digital strategy and expanding your online reach. However, these tags can slow down the website and impact user conversion rates if not implemented properly.

In addition, there are multiple risks associated with code injection, i.e., the process used to add GTM tags to web pages. Threat actors can use it to edit tags and add malicious code to your website.   

To avoid such issues, you should always insulate your GTM code with try/catch exceptions. This way, misfired tags/error-prone tags firings won’t cause website slowing issues and affect your end-user functionality.

Your IT outsourcing partner can use the error logs and objects to find issues if required. If you need help, you can always reach out to the Google Tag Manager Community page, as many advanced developers share their custom templates there.

Companies should implement test containers that allow them to see how their tags are fired before they are published in production environments. This will help prevent issues in live websites if a tag misfires. 

Creating a different container for test configuration also has a support side advantage. If there’s any issue, the admin can always revert to the previous configuration without loss of data or downtime. 

Since multiple teams use and manage GTM in an organization, things can quickly get messy if usage protocols are not defined. A role-based access approach is the best way to prevent unauthorized users from implementing changes in production containers. 

Common Mistakes to Avoid When Debugging With Google Tag Manager

Even though GTM is very easy to use, sometimes admins face issues while working on it. Here is how you can debug and fix some common GTM issues. 

  1. The preview and debug mode is extremely useful if you’re testing and implementing new code on your container. After opening the window, it will prompt you for the container name and target URL. You can also select individual tags to work on. The “Share debug session” option allows your colleagues to view your changes. 
  2. Sometimes you get stuck in a situation where you have closed the debugger, but the dialog box for preview mode is still hovering at the side of your screen. To exit your debugger, delete third-party cookies and disable ad blockers. 
  3. If you’re facing data loss, you can use the data layer options to determine the exact moment the data was lost. You can use the option on the left pane to get the exact event key. 
  4. Different users may have different user journeys depending on the type of campaign ad they clicked. Furthermore, they may come from many different domains to your landing page. 
  5. You can use the tag assistant extension and preview mode to determine a user’s domain and add it to GTM using the add domain option. This will allow the tool to track the first-party cookies from different domains and manage their data.
  6. The data layer has multiple tabs such as page view, user info, window loaded, DOM ready, etc. Admins often use these tabs to push data to the data layer, from where the data is pushed to third-party applications. 

Before passing any data to any third-party applications and websites, you must ensure that the required fields are in the data layer. The form submission event displays the fields available to the user. You can check this event and make sure that the required variable is present in the data layer when the tag is fired. Otherwise, the tag firing won’t push any data to a third-party tool.

  1. Sometimes, you may face a situation in which your tags get fired even if the trigger conditions are not met. Conversely, there may be situations where tags are not fired even if the trigger conditions are met. This happens because the user hasn’t set up tag sequencing. 

Tag sequencing is a process that lets you fire tags sequentially. It allows you to set up primary and secondary tags that fire one after the other. This option for Tag Sequencing is available under Advanced Settings. 

There are two types of tags in tag sequencing. A setup tag is a tag that fires before the primary tag, whereas a cleanup tag fires after the primary tag. You can also add triggering options (the primary tag fires only after successfully firing the setup tag). 

Using Google Tag Manager for Your Organization 

Google Tag Manager is one of the most popular digital marketing tools in the world. Many organizations use Google Tag Manager in conjunction with Google Analytics. It reduces the need for manual tagging (and management) and allows you to track user interactions such as button clicks, form submissions, video watched, etc.

Marketing managers can use this information for generating business intelligence and understand website performance. 

This tool enables you to generate and implement tags quickly. You can also use this to manage third-party tags for remarketing, conversion tracking, and understanding site analytics. You can also set up sequences, triggers, and macros for your tag firings. 

Since multiple departments within an organization use this tool, admins need to use access control settings to manage its usage. You can also set up different testing and production containers to ensure that no unreviewed code is deployed to live environments.

Share

About the Author

Natasha Rei is the Digital Marketing Manager of Explainerd, an explainer video production agency. She ensures strategic goals are met by directing online and social media campaigns.

Have Questions?