Google Tag Manager (GTM) is a convenient and simple tool for managing tracking codes and analytics: counters, pixels, and other scripts of third-party systems. Thanks to this tool, you can add tags to the site without the intervention of the developer. More precisely, the webmaster adds the container or master code to the site once, after which the codes and scripts can be added directly through the GTM web interface.

You don't have to wait for the developer to find free time to put the code on the site. You can do everything yourself, and save money on developers as a bonus.

It is also possible to implement the necessary changes faster — for example, change analytics settings, connect tracking of new forms and buttons, more effectively configure contextual advertising and analyze traffic.

Advantages and disadvantages of Google Tag Manager

Before using the tool, let's understand what its advantages are compared to the traditional placement of tags and scripts.

  • You can integrate almost any tags. In addition to Google Analytics templates, there are ready-made solutions for the most popular analytics and advertising services and systems. If you can't find a suitable template, you can use the "User HTML" template.

Що таке Google Tag Manager та скільки займає первинне налаштування? - 2-

"Custom HTML" and "Custom Image" allow you to solve any tasks that did not involve development.

  • Ability to debug the tag before launching it on the site . For this, a view is used.
  • Version control . You can always roll back to the previous version of the settings in two clicks.
  • Asynchronous loading of tags . Unlike analogues, GTM practically does not affect the site loading speed.
  • The ability to perform text replacement on the site without interfering with the code . This is a boon for the marketer, who can now test headlines and other textual elements of the site without involving a developer.

Now let's move on to the disadvantages:

  • Problem setting goals on Getcourse widgets . Recently, I myself faced such a problem. To set it up, I had to first set up the interaction of GetCourse with Google Analytics 4 and only then connect the target to Google Tag Manager. Perhaps the same problem will be with other services that offer to use third-party code in widgets and application forms.
  • Need to use Google mail . You will need to register an account that will definitely stay with you if the specialist who works with the site leaves.

In general, Google Tag Manager has more advantages than disadvantages. The existing disadvantages are local and not every entrepreneur and advertising specialist faces them.

Terms used in GTM

To start working with the tag manager, you need to find out the terminology of this service in order to understand what and how it works. Look at what this or that term in the service is responsible for, and you will quickly understand its meaning and purpose:

Term Description
Tag JS code, or rather a small fragment of it, executed by the system. In this case, the JS code is a script that is installed on the site through GTM. A trigger is connected to it. GTM has a large number of different tags, which allows you to connect the tag to the site without knowing JS
Trigger An event that includes the operation of a tag. Usually the trigger contains some kind of event: clicking a button, following links, scrolling a page, filling out a form
Changeable The parameter for which the condition is passed. For example: Click URL or Scroll Direction
Container Shells for all tags on the site. Responsible for launching third-party services

Installing Google Tag Manager on the site

Now we will look at two ways - one that is suitable for everyone, as well as a specific way to install on a WordPress site.

A universal way of connecting to the site

Next, we need to go to the Google Tag Manager site to do the initial setup. To register in the service, you will need a Gmail email. Click on the Start for free button:

Що таке Google Tag Manager та скільки займає первинне налаштування? - 3-

Start page

Add a new account:

Що таке Google Tag Manager та скільки займає первинне налаштування? - 4-

We create an account

We specify the name of the account: I have this name of the author of the blog on which GTM will be installed.

Account settings: be sure to specify the country:

We create a container: we specify the name and choose the target platform for work. In my case it's "Website":

Що таке Google Tag Manager та скільки займає первинне налаштування? - 5-

When creating the container, we specify that we have a website

After clicking the "Create" button, a window with two code fragments opens. Now we are interested in the first fragment - copy and paste on the site.

Що таке Google Tag Manager та скільки займає первинне налаштування? - 6-

The system offers to install the code on the site

Відкриваємо код потрібного сайту у редакторі. У вас це може бути редактор хостингу, а мені зручніше користуватися програмою Notepad++. Вставляємо перший код якомога ближче до тега <head>. Це робиться для того, щоб ви змогли відстежити навіть користувачів, які закрили сайт до моменту повного завантаження. Ось так виглядає код на сайті:

Що таке Google Tag Manager та скільки займає первинне налаштування? - 7-

Перша частина коду встановлюється відразу після тега <head>

Копіюємо другий код. Його потрібно розмістити відразу після тега <body>. Логіка тут така сама. Чим швидше завантажуватиметься тег Google Tag Manager, тим повнішою буде статистика.

Що таке Google Tag Manager та скільки займає первинне налаштування? - 8-

Друга частина коду після тега <body>

The installation process is quite simple, although it is better to use ready-made plugins or modules on CMS, because it will be more reliable. Now we will look at installing GTM in the following way.

Installing Google Tag Manager on WordPress

There are several ways to connect:

  • Install the container in the site code.
  • Installation using a plugin or module.

The choice of a specific method depends on the technical features of your site, as well as on the CMS used. In some cases, you will have to use the services of a developer. I will consider installing the system on the most popular CMS WordPress. It is not necessary to dig into the site code, you can use the ready-made Google Tag Manager for WordPress plugin.

Before starting the installation, it is better to think about what tags you will need so as not to rush through the setup process.

What is a global tag?

The traditional way of installing analytics systems involves using the gtag.js global site tag. This method is not very flexible, because all editing will have to be done by hand directly in the site code and all third-party scripts must be installed using the resource developer. These are additional costs for business.

For a new site, we recommend using Google Tag Manager right away. But the question arises: what to do if the site already has a global tag? You can easily use these two methods at the same time to remove already installed gtag.js code is optional.

Tag settings

Since we have taken as an example a site on the WordPress engine, the Google Tag Manager for WordPress plugin by Thomas Geiger was used for installation. You can find and install it directly from the site's admin panel. In WordPress, go to the "Plugins" tab and click on the "Add New" button. Next, type the name of the plugin in the search bar, and the system will find it by itself:

Що таке Google Tag Manager та скільки займає первинне налаштування? - 9-

Plugin to install

Activate the plugin and go to the "Plugins" tab again. We find the installed plugin and click on the "Settings" link:

After that, we go to the personal account. If it is not configured yet, we configure it as described earlier. Do not be afraid of what will happen next: after clicking the "Create" button, the system will transfer you to a window with an offer to install the code on each page of the site. We don't need it - we're using a plugin to configure it, so we just close this window.

You need the account ID, which is found in the Administration tab. Copy the ID displayed there.

Let's return to the administrative panel of the site. Let me remind you that the plug-in settings have been started there. Paste the copied ID on the main tab. We also check the location of the container code. By default, it is placed in the basement of the site: I advise you not to change this setting, as it ensures the maximum loading speed of the site.

Що таке Google Tag Manager та скільки займає первинне налаштування? - 10-

Connecting the account to the plugin on the site

Next, we need the Integration tab. Google Tag Manager can integrate with several popular plugins, and in this tab we can choose which ones. I have the Contact Form 7 plugin installed, I check the check box. If you have other plugins from the list on the tab, enable the integration, this will allow them to interact effectively.

Що таке Google Tag Manager та скільки займає первинне налаштування? - 11-

We connect to the Contact Form 7 plugin

Now it remains only to save the changes.

Go to the control panel to configure the tag. The first thing they usually do is connect to the Google Analytics 4 site. Analytics Universal is connected to the site from the example.

In the working area of ​​the service, click on the "New tag" tile or on the "Add a new tag" link:

Що таке Google Tag Manager та скільки займає первинне налаштування? - 12-

We create a new tag

See the two fields? In one, we configure the tag, and in the other, we select the trigger that will activate it. At this stage, we are interested in the "tag" field.

Що таке Google Tag Manager та скільки займає первинне налаштування? - 13-

This is what the start page for setting up a new tag looks like

We go to Google Analytics 4 and find the flow ID. Log in as an administrator and click on "Data Streams".

Що таке Google Tag Manager та скільки займає первинне налаштування? - 14-

We find the Google Analytics ID 4

We select the desired data stream. You can have multiple threads, so choose the appropriate one.

Next, we get to the "Stream Details" tab. Here you need to copy the ID of the data stream.

Return to the Tag Manager page. Give the name of the tag and click on the configuration. A window opens where we insert the identifier copied from GA4:

Що таке Google Tag Manager та скільки займає первинне налаштування? - 15-

Now let's make settings in the "Triggers" die:

Що таке Google Tag Manager та скільки займає первинне налаштування? - 16-

We configure the trigger to activate the configured tag

Three standard triggers are offered here. We need to set up simple tracking, so we choose All Pages:

Що таке Google Tag Manager та скільки займає первинне налаштування? - 17-

Select the trigger "All pages"

The Tag Setup window will look like the one below. All we have to do is click the "Save" button, and the initial setup is complete.

Що таке Google Tag Manager та скільки займає первинне налаштування? - 18-

This is what the tag looks like after configuration

Next, the configured settings need to be published. To do this, click the "Publish" button on the main page. Here you can see one of the advantages - when you can assign any name to the version of the settings and return to them at any time if necessary.

Initial setup takes 20-30 minutes and does not require any special knowledge or skills. You may not even need a keyboard because everything can be done with the mouse buttons. This approach significantly expands the possibilities and simplifies the life of a novice Internet marketer.