Google Tag Manager – what is it and how to use it?
Google Tag Manager has been on the market for many years, but it is still not as popular as other tools from Google. Nevertheless, Tag Manager is perfect for managing scripts on smaller and larger websites. See for yourself what you can do with it and how it can be useful for you too!
What is Google Tag Manager?
Google Tag Manager allows you to easily add and manage scripts to your website. These scripts, also known as tags, are simple programs that are opened under strict conditions and are primarily used to collect data using tracking codes.
Without Google Tag Manager, the scripts must be inserted into the code of the site. This is a difficult and tedious task. It is also easy to make a mistake or omit one of the pages, making the collected data not reflect the reality.
Installing Tag Manager allows you to easily implement new scripts, manage them and test their performance.
Structure in Google Tag Manager
The tag manager from Google has a specific structure that makes it easy to organize the scripts on your site. The hierarchical structure of the program makes it easy to quickly navigate through the program.
- Account. Typically, you use a single Google account with multiple sites and applications.
Container. This is a piece of code to be installed on a single page or application. In this way, it will be connected to Google Tag Manager. So each container is responsible for a different site or mobile app.
- Folder. With complex websites, the number of tags can be very large. Therefore, Tag Manager allows you to create optional folders (collection of tags) to better organize the scripts on a given page.
- Tag. Individual tags are placed in containers and folders. These are scripts that will be placed on the page to collect relevant data, trigger redirects or pup-ups, and provide other additional functionality on the site.
- Rule. Installing a tag is still not enough. In order to run it, you need to define appropriate rules, i.e. a set of conditions that must be met for the script to work. One tag may have several rules.
- Variable. These are the values stored in tags or rules, which are changed by the action of users. When they are placed in the script, they allow to collect dynamic data (for example the amount of purchases made). On the other hand, variables in rules are responsible for fulfilling the condition of running the tag (clicking the banner or the “buy now” button).
Improve your performance with Google Tag Manager
A tag manager makes it significantly easier to work with scripts on a website. Container templates can be especially helpful.
Having already a ready and fully implemented set of tags on one of the pages, we can easily transfer it to another site. Thanks to that, we will avoid tedious introduction of all the scripts from scratch.
To make such a transfer, all you need to do is export the container template in JSON format. You can then import it into the new site.
In the same way, you can create and restore backups of containers before making major changes to them. When importing into an existing workspace, you will see a “replace” and “merge” option. The former allows you to remove changes made after the export.
The data layer in Google Tag Manager
Using the data layer, you get access to all the most important information at the Google Tag Manager level. This significantly facilitates the creation of variables and work on various scripts.
Data layer objects consist of key-value pairs. The key is the category, while the values are specific data. For example, the key can be a car brand, and the values assigned to it are: Renault, Fiat, and Mercedes.
In order to implement a data layer on a website, you need to add an appropriate script to its code.
Why use Google Tag Manager?
There are many benefits to installing and using Google Tag Manager. First of all, it makes it easier to organize and manage your website, as well as collect relevant data for analysis. The scripts are also used to open pop-ups and perform redirects. Therefore, it is worth learning more about the benefits of using a script manager.
Saving developers’ time and yours
It takes a lot of time and effort to manually enter scripts on the website. Often, it can be done only by an IT specialist, for whom working in the website code is not such a problem.
A script manager, on the other hand, allows you to easily enter new scripts without knowing the code and its structure. Thanks to that, it can be done by the website owner or a trained employee. There is no need to use the programmer’s help, which significantly reduces the costs of running the portal.
One place to manage all your tags
Extensive websites contain many sub-pages. Each of them should have proper code implemented so that tags work properly on your site. When entered manually, it’s easy to make a mistake and overlook one of the pages.
This leads to incorrect data for analysis. The difference is not always easily visible, which can lead to wrong conclusions based on the data analysis done in Google Analytics.
Also, other actions that scripts are responsible for may not work then on individual pages. If the site has a large number of subpages, such a mistake may be impossible to find.
Google Tag Manager automatically adds tags to all subpages that you select. Additionally, you can see at any time where the script is functioning and add it to the missed subpage. In this way, you can easily supervise the correct implementation of tags on the entire site.
Easy installation of various tools
Many tools, especially from Google, require you to install the appropriate tags on your site. Using the Manager makes it significantly easier to do so. It also translates into faster and easier installation of analytics tools on the site, such as:
- Google Analytics,
- Google Ads,
- Google AdSense,
- Crazy Egg.
Without Google Tag Manager, installing these programs would require changes to the source code and the help of a programmer. However, Tag Manager will help the website owner to do it without any problem, regardless of his/her knowledge of HTML and CSS.
Verifying a website in Google Search Console
If the website will have Google Tag Manager code implemented, it can be verified in Google Search Console tools. They allow you to monitor your website for SEO and page marketing.
It makes it easier to determine how Google robots index the content or if any penalties are imposed on the site. So it is a necessary set of tools for SEO audit. They are also useful for people who are trying to position a particular website.
Google Tag Manager is a safe way to implement modifications in the area of analytics and measurement scripts. This is because it avoids changes to the source code of the website or mobile application itself.
How dangerous changes in the code are can be proved by the fact that they can even block the website completely. All it takes is an unclosed parenthesis or a misspelled command for the entire code to stop working properly.
Severe source code corruption may even require a backup restore. This danger can be avoided by using the Tag Manager.
Google Tag Manager allows you to optimally install the appropriate scripts, and a set of rules is responsible for running them properly.
As a result, sites with Tag Manager installed tend to run faster than those where such implementations are done manually.
Ease of use
The intuitive interface and simple way to add containers, tags and rules allows even non-IT people to work. It is a simple tool that allows you to perform difficult tasks.
You don’t need to know HTML or CSS to properly implement even a very complex tag in a page or application.
How do I create an account on Google Tag Manager?
In order to run Tag Manager, you need to have an account on Google. You just need to have an email account on Gmail, and the username and password you have on it will allow you to sign in at tagmanager.google.com.
Next, you need to configure your account by entering details such as:
- the name of the first container,
- the platform you want to assign it to,
- and the country.
Now it’s time to install the service on your site. This requires pasting a few scripts into the source code of your website. If you don’t have adequate knowledge of HTML, it’s a good idea to enlist the help of a professional. However, having basic knowledge, it is possible to do it yourself.
How to use Google Tag Manager? Add Google Analytics code
When you first log in, you already have a container where you can add your first tag. After selecting “new tag”, you can paste the script code or choose a ready-made solution for the most commonly used programs and tools, like Google Analytics tag.
Next, you need to add variables and rules. This way you can specify when the added script will work.
When everything is ready, you should publish the container. This is an often forgotten step, causing scripts to fail to collect data even though they are properly defined.
Google Tag Manager preview mode, or check how your Tag works
The preview mode is also very useful. It allows you to see the changes that have been made. This way you can easily check if the rules are working correctly and the script is functioning as intended.
Easier site management with Google Tag Manager
Google Tag Manager is not very popular. However, it allows you to easily and quickly manage the scripts on your site. Especially for complex and large sites, this is a very useful tool.
A great convenience is also the ability to import containers from one site to another. In this way, once introduced scripts on one site can be instantly transferred to other sites.