Why Do You Need Google Tag Manager?

Google Tag Manager Web analytics

A marketer asks a programmer to place a pixel. The programmer is busy, the task hangs for a week, and ads run blindly. Sound familiar? Google Tag Manager removes this dependency: the service is installed once, and from then on, tracking codes, pixels, and events are added from the web interface in a matter of minutes.

Below, we will break down how the service works, how to install it on a website, and how to set up the first tags—with examples for ecommerce and the service industry.

What is Google Tag Manager in simple words?

Google Tag Manager is a free tag management system. In the Russian interface, it is called a “tag dispatcher” or “tag manager,” but in everyday use, it’s simply GTM.

A tag is a JavaScript code snippet from a third-party service: a Google Analytics 4 tracking code, Google Ads conversion tracking, a Facebook pixel, or a Hotjar script. Previously, each such snippet was inserted directly into the layout. Now, there is only a container on the pages, and all other scripts and the rules for firing them are stored within it.

It is similar to an electrical panel in an apartment: the wiring is laid in the wall only once, and the circuit breakers are later turned on, off, and replaced without additional wall chasing.

What is Google Tag Manager used for and who benefits from it?

Why do you need Google Tag Manager?

The easiest way to understand what Google Tag Manager is used for is with a real-life example. Take a home appliance store that advertises on Google Ads, Facebook, and TikTok. You need to insert specific code for each platform and track target actions: product views, add-to-carts, and purchases. Without GTM, this means 10–15 tasks for a programmer (at a rate of, say, 600–800 UAH per hour, the amount adds up noticeably). With GTM, the developer outputs purchase details into the dataLayer just once, and the marketer sets up the rest themselves.

Tasks the service solves:

  • connecting GA4, Google Ads, and other tracking codes without editing the template;
  • tracking actions: clicks on phone numbers and messengers, form submissions, scrolling, video views, file downloads;
  • sending conversions to advertising accounts;
  • setting up ecommerce and dynamic remarketing;
  • installing online chats, call tracking, and heatmap services;
  • testing tags before launch and rolling back to a previous version in case of an error.

There is another bonus—speed. The asynchronous loading of the container does not block rendering: the content is displayed, while the rest loads in parallel. However, this is not a free pass. Twenty heavy scripts in a container will slow down pages just as much as twenty scripts hardcoded manually.

And who doesn’t need the service? A single-page website with a single analytics tag and no advertising will do fine with direct installation. But as soon as a second advertising channel or a first event appears, the container immediately pays off the effort spent on its setup.

Main advantages of using Google Tag Manager

The main plus is speed. A new pixel or event starts working the same day, rather than waiting in the developer’s task queue. Suppose a promotion launches on Friday evening, and you urgently need to track clicks on a banner. With Google Tag Manager, this is 15 minutes of work for a marketer: tag, trigger, testing, publication.

Other advantages are clearly visible in daily work:

  • Order in the codes. Tracking codes, pixels, and scripts lie in a single interface, rather than being scattered across different files. A year later, it is easy to understand what is installed, by whom, and why.
  • Testing before launch. Preview mode shows which tag fired and what values were sent—visitors do not notice a thing.
  • Insurance against errors. Every publication is saved as a version. If statistics break after changes, you can roll back to a working state in just a couple of clicks.
  • Ready-made templates. GA4, Google Ads, and Hotjar are connected without a single line of code, while Facebook and TikTok have presets in the gallery.
  • Flexible access. An advertising contractor is granted permission to edit, but not to publish, while FTP and the admin panel remain closed off.
  • Zero cost. The free version is sufficient for both a small service website and a store with 20,000 products.

There is another plus that isn’t noticed immediately: variables and triggers are reused. Let’s say a “successful form submission” is set up once—and a GA4 event, a Google Ads conversion, and a Lead for a pixel are all attached to it. Did the form change? You edit one condition instead of five insertions in different files.

Attention! The ease of setup is a double-edged sword. Through the tag manager, any JavaScript can get onto the site, including ones with errors. Do not give publishing rights to just anyone, and check all Custom HTML tags in preview mode.

How does GTM differ from GA4 and gtag.js?

Beginners often confuse these three things.

Google Analytics 4 stores data and builds reports. GTM stores nothing and shows no reports—it only routes information to systems. One tool is a warehouse and a showcase, the other is a courier.

gtag.js is a library for sending data directly to Google products. It is written in the source code, and every new event requires editing it. GTM does the same thing through an interface and works with third-party services as well.

In 2026, the boundary between them became thinner. Google announced that tags will be upgraded to full-fledged Tag Manager containers: properties with just a single tag will receive interface configuration, debugging, and version control. Nothing changes automatically—the new configuration is accepted optionally, and proposed edits are reviewed before publication.

On the structure of Tag Manager (basic terms)

There are not many terms, but without them, the instructions below will be incomprehensible.

Account and container

An account is the top level, usually one per company. A container is a set of tags for a specific website or app. A container has an ID like GTM-XXXXXXX, which is embedded in the installation code.

The rule is simple: one website—one container. An agency with ten clients shouldn’t dump everything into its own account, but rather gain access to the clients’ accounts. Otherwise, you’ll have to transfer everything when parting ways.

Tag, trigger, variable

All logic rests on this trio:

  1. A tag answers the question “what to do?”—send information to GA4, fire a pixel.
  2. A trigger answers the question “when?”—on load, on click, on form submission, on a new entry in the data layer.
  3. A variable answers the question “with what data?”—page URL, button text, order amount.

Example: the “GA4 – click_phone” tag fires on a “click on a link” trigger with the condition: the Click URL variable starts with tel:.

Tag Manager structure

Variables can be built-in (Page URL, Click Text, Form ID—you enable them with a checkbox) and user-defined. Of the user-defined ones, the most requested are the “Data Layer Variable”, “Constant” for storing IDs, and “Custom JavaScript”.

Configuration of embedded variables

Data layer

DataLayer is a standard JavaScript array on the page. Information unavailable from the layout ends up there: order number and amount, cart contents, user type. GTM reads the array and distributes the values to the tags.

An event is sent in a single line:

html < script > window . dataLayer = window . dataLayer || []; dataLayer . push ({ ‘event’ : ‘callback_sent’ , ‘form_name’ : ‘Callback’ });

Such a call is more reliable than any “guessing” by button classes. If a designer renames a class, click tracking breaks. But an event from the code will continue to work.

Workspace

This is your draft. Until changes are published, visitors do not see them. In the free version, three workspaces are available: this is convenient when an advertising contractor and an in-house analyst are working in parallel.

Each publication creates a version. They work like save points in a game—you can return to any of them in two clicks.

How to create an account and container in Tag Manager?

You will need a standard Google account. A corporate one is better than an employee’s personal email—people quit, and access is lost.

Go to tagmanager.google.com and click on “Create Account”. Name the account after the company, and set the country to Ukraine.

Creating an account in GTM

For the container, the domain name is most often used, for example, mysite.com.ua.

Customizing tags in Google Tag ManagerThe target platform is “Web”. iOS, Android, AMP, and Server (server-side tracking) are also available. When everything is filled out, agree to the terms of service.

After this, a window with two code snippets will immediately open. Do not close it—they will be needed in the next step. If you did close it, the snippets can always be opened by clicking on GTM-XXXXXXX in the header.

Tag manager script

How to install Google Tag Manager on a website?

The container has been created, but so far it only exists in the interface—the website knows nothing about it. For Google Tag Manager to start working, add its code to the page template. The method depends on the platform: somewhere it’s enough to enter the ID in the admin panel, elsewhere you’ll have to edit the header file. The entire procedure takes 10–15 minutes and is done once.

Code in head and body

Installation comes down to two insertions into the template:

  • the script from the first snippet—into the head, closer to its beginning;
  • the noscript block from the second—as the first line inside the body.

Both pieces must be present on every page, including the cart, checkout, and “Thank you” screen. Therefore, the code is placed in the global header template, rather than point-by-point.

A common question: is the noscript mandatory? It fires for visitors with disabled JavaScript, which is a tiny minority. But it is also required to verify property rights in Search Console via GTM, so install both.

Installation via CMS

You do not always have to edit theme files manually:

  • WordPress — the GTM4WP plugin or a code field in the theme settings; the plugin also generates a dataLayer for WooCommerce;
  • OpenCart — a module from the marketplace or insertion into header.twig;
  • Shopify, Horoshop, Prom.ua, and other SaaS platforms — a field for the container ID or custom scripts in the admin panel;
  • Tilda, Wix — built-in integrations, just enter the GTM-ID.

Attention! Before installing, check if GA4 or pixels are placed directly in the code. If you add the same tracking codes via GTM without removing the old ones, all events will be sent twice—pageviews and conversions will be duplicated.

Checking the installation

Open the site, press Ctrl+U, and find the line with GTM- and your ID in the source code. There is a faster way: the “Preview” button in the interface. If the debugger connects, the container is in place.

How to set up Google Tag Manager?

An empty container does nothing. Next are five settings that most projects start with. At the same time, it will become clear how to use Google Tag Manager in daily work: the logic is the same everywhere—tag, trigger, testing, publication.

Connecting Google Analytics 4

  1. Copy the ID like G-XXXXXXXXXX: in GA4, it’s located in the “Admin” section → “Data Streams” → web stream.
  2. In GTM, create a new item (“Tags” → “New”).
  3. Fill in the “Tag ID” field with the copied G-XXXXXXXXXX.
  4. Set the trigger to Initialization – All Pages (just All Pages will also work).
  5. Save it under a clear name—say, “GA4 – Config”.
Using the Universal Analytics tag
Practical tip: extract the ID into a “Constant” variable. When setting up ten events, you won’t have to copy it ten times, and if the property changes, one edit will suffice.

Tracking clicks on phone numbers and messengers

For a dental clinic, an auto repair shop, or a law firm, a call is more important than a form. Let’s set up tracking for clicks on a number.

Create a new trigger in GTM

First, enable the built-in variables from the “Clicks” group: Click URL, Click Text, Click Classes. Then create a “Click – Just Links” trigger with the “Some Link Clicks” condition: Click URL contains tel:. For Telegram and Viber, the conditions are similar—t.me and viber://.

Customize additional conditions for the event

Next, the tag: type “Google Analytics: GA4 Event”, stream ID, event name click_phone. Attach this condition to it—and you’re done.

Form submission

It is more complicated here. The built-in “Form Submission” trigger only catches the classic scheme with a page reload. It often doesn’t see modern AJAX forms (or it sees them but fires even with empty fields).

Working options in descending order of reliability:

  1. An event in the dataLayer. The programmer adds dataLayer.push after a successful submission, and a “Custom Event” trigger with the same name is created for it in GTM.
  2. Thank you page. If /thank-you/ opens after a request, a “Page View” trigger with a Page Path condition is enough.
  3. “Element Visibility” trigger. This works if a “Thank you, we will call you back” block appears afterward—you specify its CSS selector.

You will need two tags. The first is “Conversion Linker” with a trigger on all pages. It saves the ad click identifier. The second is “Google Ads Conversion Tracking”: you insert the conversion ID and conversion label from the ad account (“Goals” → “Conversions” → desired action → “Use Google Tag Manager”).

The trigger is the same as for GA4: a successful form submission or purchase. For a store, add data layer variables to the “Conversion Value” and “Transaction ID” fields, then the actual purchase amounts will appear in the account and duplicates will disappear.

An alternative is to import key events from GA4 into Google Ads. Setup is faster, but the numbers arrive with a delay, and the systems have different attribution models.

Facebook, TikTok, and Hotjar Pixels

There is no ready-made Meta tag in the standard list. There are two solutions: presets from the Community Template Gallery (“Templates” → “Search Gallery”) or the “Custom HTML” type, where the code from Events Manager is pasted in entirely. A template is more convenient—events are selected from a list in it, rather than written manually.

For TikTok, there is an official Pixel template in the gallery: you enter the pixel ID, select the event, and set the trigger.

Hotjar is the easiest to connect—the Hotjar Tracking Code type is among the built-in ones; you just need to enter the Site ID from your personal account.

Attention! Templates from the gallery are written by third-party developers. Before connecting, look at who the author is and what permissions are requested. Use solutions from the platforms themselves or well-known agencies.

Order data

It is not enough for an online store to know that a purchase took place. You need the amount, order contents, and product categories—without this, you cannot calculate the return on ad spend by campaigns.

The scheme goes like this. On the successful order page, a purchase event is sent to the data layer:

html < script > window . dataLayer = window . dataLayer || []; dataLayer . push ({ ecommerce : null }); dataLayer . push ({ event : ‘purchase’ , ecommerce : { transaction_id : ‘10482’ , value : 2490 , currency : ‘UAH’ , items : [{ item_id : ‘KM-205’ , item_name : ‘Burr coffee grinder’ , price : 2490 , quantity : 1 }] } });

The line with ecommerce: null clears the previous content, otherwise, products from the previous call will “stick” to the new one.

In GTM, you need to add a “Custom Event” trigger named purchase and the corresponding GA4 tag. In its settings, enable “Send Ecommerce data” and select Data Layer as the source. The view_item, add_to_cart, and begin_checkout events are set up using the same scheme—together they provide a funnel from the product card to payment.

By the way, for WooCommerce, OpenCart, and Shopify, ready-made modules generate such an array themselves. For custom-built stores, a programmer needs a technical specification with a list of events and parameters. Use names from the official documentation as a basis so that reports are populated without additional mapping.

How to test tags in preview mode?

Publishing without testing is a bad habit. Debugging takes five minutes.

Click “Preview” in the upper right corner. Tag Assistant will open: enter the website URL, and it will launch in a new tab with the debugger connected. Now perform a target action—click on a phone number, submit a test request, or place a trial order.

What to look for in the Tag Assistant window:

  • on the left—the event timeline: Initialization, Container Loaded, DOM Ready, clicks, and everything you sent to the dataLayer;
  • “Tags” tab—two lists: Tags Fired and Tags Not Fired;
  • “Variables” tab—values at the time of the event;
  • “Data Layer” tab—what exactly went in there.

Did a tag fail to fire? Click on it: the debugger will show the firing conditions and mark the unfulfilled one with a cross. Usually, the reason is trivial—a typo in the event name or an extra slash in the URL.

All that’s left is to make sure the data reached the recipient. In GA4, open “Admin” → DebugView: events from the debug session appear there in a few seconds, with parameters. Pixels have their own tools—”Test Events” in Meta Events Manager and a similar section in TikTok Ads.

What changed in the GTM interface in 2026?

If you opened the service and didn’t find the familiar items from old instructions in the menu—an update is the reason. Google redesigned the overview screen: container configuration moved to the Settings section, while triggers, variables, templates, and folders are grouped in the collapsible Advanced block. Functions were not removed—only the layout changed. The Russian section names in your account may differ, so use the composition of the items as a guide.

The second innovation is visual event setup without programming. For now, it works in beta for purchase conversions in Google Ads, and other scenarios are promised to be added gradually.

The third is container optimization. It is launched via a banner in the account, is available to users with edit, approve, or publish permissions, and all changes can be previewed. For complex configurations with dozens of tags, there is no need to rush: first, study the proposed edits and run through the main scenarios.

Common mistakes when setting up Tag Manager

In general, setting up Google Tag Manager does not take much time. It is harder to avoid the pitfalls familiar to any analyst.

  1. Changes are not published. A classic: a tag is created, works in preview, but reports are empty. Preview mode is only visible to your browser—other visitors will only see the changes after you click the “Submit” button.
  2. Double counting. GA4 is installed both in the code and in the container. The symptom is a bounce rate near zero and twice as many pageviews as before.
  3. Trigger on all clicks. A “request” event is attached to any click on a button with the btn class, and there are fifteen such buttons. The report shows 300 conversions, while the CRM has 20.
  4. Container code is not on all pages. Most often, the checkout on a subdomain or landing pages on a separate template are forgotten. Purchases are lost entirely in this case.
  5. Test orders in statistics. You debugged ecommerce with a trial purchase for 99,999 UAH—and the average order value for the month skyrocketed. Exclude internal traffic with a filter or cancel test transactions.
  6. Forgotten cookie consent. If a store sells to EU countries, tags must respect the user’s choice in the banner. To do this, each of them has consent settings, and there are ready-made banner templates in the gallery.

And lastly. Setting up Tag Manager is not a one-time event. A website changes: a redesign, a new form, a different payment system. Once a quarter, open preview mode and go through the customer journey from entry to order—a ten-minute check is cheaper than a month of advertising with crooked statistics.

Rate author
Adwservice
Add a comment

Yana Liashenko
Yana LiashenkoGoogle Ads AI Architect GoogleLogist
I build Google Ads systems for e-Commerce businesses, where every campaign is not just a set of settings, but part of an architecture that enables profitable scaling.
Sergiy Shevchenko
Sergiy ShevchenkoGoogle Ads Profit Engineer GoogleLogist
I scale eCommerce sales by training Google Ads AI. Sales growth with profitable ROAS and international expansion.