What Is Google Tag Manager, How to Set It Up and How Does It Work?

Topics: ,

If you want your business to succeed in the digital world, you need to track where the visitors to your website come from, what they do on it and whether they buy. For every such piece of information and every tool you use, you need a special measurement code. In the past that meant calling a programmer, waiting weeks for implementation and paying thousands. Today it is enough to put a single code on your website, and you manage everything else yourself through a simple web interface. In this article we will tell you what Google Tag Manager is, how to set it up and how it works.

Summary for Those Who Don't Have Time to Read the Whole Article

  • Google Tag Manager is a free tool from Google for managing all your measurement codes in one place.
  • You put just one GTM code on your website and through it you then manage all the other measurement and marketing codes.
  • GTM works on the principle of tags, triggers and variables, which together determine what code should run, when, and with what data.
  • If you break something, you return to the previous working version with one click.
  • Google Tag Manager can handle both basic and advanced measurement, from simple visit counting to detailed e-commerce tracking and custom events.

What Is Google Tag Manager?

Google Tag Manager (GTM for short) is a free tool from Google that works as a central control panel for all the measurement codes on your website. Instead of putting each measurement code (for example for Google Analytics, Facebook Pixel or Sklik) directly into the source code of the website, you put in just one GTM code. You then manage everything else through a clear web interface, much like using Gmail or Google Drive.
GTM gives you freedom and control over the measurement of your website. You do not have to dig around in code or ask programmers for help, you simply set up what you need to measure yourself.

What is Google Tag Manager?

How Does Google Tag Manager Work?

The principle is surprisingly simple. What is Google Tag Manager from a technical point of view? It is a JavaScript code that acts as an intermediary between your website and all the measurement tools. When a visitor comes to your website, the GTM code activates and, according to your settings, fires the individual measurement codes.

The Three Pillars of GTM

The whole system stands on three basic pillars:

  • Tags are the measurement codes themselves that you want to run on your website. It can be a Google Analytics code for tracking traffic, Facebook Pixel for remarketing or, say, a Google Ads conversion code. Each tag has its purpose and collects specific data.
  • Triggers determine when each tag should be activated. For example, you can set Google Analytics to fire on every page load, but the conversion code only on the thank-you page after a purchase.
  • Variables are dynamic values that change depending on the situation. It can be the URL of the current page, the price of a product in the cart or the text of the button someone clicked. Variables give your measurement context and detail.

All these components are stored in a so-called container, which is essentially a package of all your settings for a specific website.

Data Layer

For more advanced measurement, especially in e-commerce, a data layer (DataLayer) is used. It is a way of passing important information from the website to GTM. For example, when a customer adds a product to the cart, the data layer passes GTM information about the product name, its price, category and quantity. GTM then sends this information to Google Analytics, Facebook Pixel and other tools that need to know what is happening on the website.

Without a correctly set up data layer it is very hard to use advanced features such as Enhanced Ecommerce in Google Analytics or dynamic remarketing in Facebook Ads.

What Is Google Tag Manager Used For?

If you are still wondering what you actually need Google Tag Manager for, imagine this typical situation: You want to launch a new campaign on Facebook and you need to install the Facebook Pixel. Without GTM you have to ask a programmer, explain what you need, wait for the implementation and pay for the work.

Or you need to measure how many people click a specific button. Without GTM that is complicated programming and developers are not keen on it. With GTM a few clicks are enough and you are done. You can even measure how far people scroll on a page, how long they stay on it or which forms they fill in.

The Most Common Uses of GTM in Practice

GTM can be used to deploy practically any measurement or marketing code. The most common use cases include:

Analytics tools

  • Google Analytics / Google Analytics 4,
  • Hotjar, Smartlook and other user behaviour tracking tools,
  • Various heatmaps and UX analysis tools.

Advertising platforms

  • Google Ads (conversion codes, remarketing),
  • Meta Pixel (formerly Facebook Pixel),
  • Sklik and other advertising systems.

Marketing tools

  • Chatbots and live chats,
  • A/B testing tools such as Optimizely,
  • Pop-up windows and forms.

Other functions

  • Cookie banners and consent management,
  • Custom scripts for measuring specific interactions,
  • Automatic measurement of scrolling, clicks or form submissions,
  • Recommendation and personalisation tools such as Luigi's Box or Vertex AI Search for Commerce.
The most common uses of GTM in practice

Advantages of Using Google Tag Manager

The main advantages of Google Tag Manager are clear: speed, efficiency, independence and control. Let us look at them in more detail.

You Save Time and Money

The biggest advantage of GTM is the dramatic saving of time and money. Instead of waiting weeks for a programmer and paying thousands for every change, you do everything yourself within minutes.

On top of that, there is no risk of a programmer breaking something when editing code. GTM is an isolated system that cannot disrupt the functioning of your website. In the worst case some measurement will not work, but the website will keep running.

You Have Everything Under Control

With Google Tag Manager you have a complete overview of all the measurement codes in one place. You see what you are measuring and when it fires, and you can change it at any time.

Versioning is a safety net that everyone will appreciate. GTM remembers all the changes you have made. If something stops working, you go back to the previous version with one click.

Testing before publishing saves you nerves. Before you push changes to the live website, you can try them out in preview mode. You can see exactly which tags fire, what data they send and whether everything works correctly.

The tool also includes so-called Workspaces, thanks to which several users can work in the tool or you can have several versions in progress.

Access management gives you control over who can do what. You can give someone read-only rights, someone else edit rights, and only trusted people the right to publish.

How to Set Up Google Tag Manager

The basic setup of Google Tag Manager takes place in several steps. If you are looking for a quick overview of how to start, here is a short guide:

Basic implementation steps:

  1. Creating an account – Register at https://tagmanager.google.com with a Google account and create a container for your website.
  2. Installing the code – Insert the two pieces of GTM code into the header (<head>) and the body (<body>) of your website.
  3. Adding the first tag – Set up a measurement code (for example Google Analytics) through the web interface.
  4. Testing – Verify that it works using preview mode before launching on the live website.
  5. Publishing – Activate the settings and start measuring.

We offer complete implementation of Google Tag Manager, which includes not only the basic setup but also advanced features tailored exactly to the needs of your business.

Advanced Features

GTM offers many advanced features. Let us look at some of them.

E-commerce Tracking

For e-shops GTM is an absolutely essential tool. It lets you track the customer's whole journey — from viewing products through adding to the cart to completing the order.

Thanks to the connection with Google Analytics 4 you get an overview of the performance of individual products, categories and sales channels.

It also includes Enhanced E-commerce features (for example measuring steps in the purchase process, interactions with products or abandoned carts), which most users today simply perceive as part of e-commerce tracking.

Dynamic Remarketing

With GTM you can easily implement dynamic remarketing in systems such as Google Ads or Meta Ads.

Thanks to the data layer, the tool can automatically send information about the specific products that a user viewed or added to the cart.

On the basis of this data the advertising platforms then show users personalised ads with relevant products – which significantly increases the return on campaigns.

Enhanced Conversions (Google Ads) and Advanced Matching (Facebook Ads)

Advanced conversion measurement features let you connect user behaviour on the website with their activity in advertising accounts more precisely.

  • Enhanced Conversions (Google Ads) uses hashed data (for example email or phone) that helps attribute conversions better even in situations where cookies are restricted.
  • Advanced Matching (Facebook Ads) works on a similar principle – it helps improve the accuracy of measurement and ad targeting using data about users who performed a certain action on the website.

Server-Side Measurement

Alongside ordinary client-side measurement, GTM also offers server-side implementation, which is becoming more and more popular.

Data is processed on your server, not in the user's browser, which brings:

  • Better protection of personal data,
  • higher measurement accuracy (less impact from ad blockers),
  • and faster website loading.

Server-side measurement is suitable above all for larger projects that want maximum control over their data and to meet the highest standards of privacy protection.

Practical Tips for Working Effectively with GTM

After years of working with Google Tag Manager I have collected a few proven tips that will save you time and nerves:

  • Create a consistent naming system (for example Platform – Type – Detail).
  • Use folders to sort tags clearly by category.
  • Add descriptions to more complex tags and triggers.
  • Always test changes in preview mode before publishing.
  • Verify that it works on different devices and user journeys.
  • Document more complex implementations for future needs.
Practical tips for working effectively with GTM

Implementation Methods

For completeness it is good to know the difference between Google Tag Manager and gtag.js, which is another way of adding Google measurement codes to a website. Both ways work great, but each suits something different.

Google Tag Manager (GTM)

  • Management of all tags through a web interface – you do not have to touch the code.
  • Support for tags from Google and third parties – Facebook, Hotjar, custom scripts.
  • The option to test before publishing – you check that everything works.
  • Versioning and access management – you can return to a previous version.
  • Requires deploying two pieces of code on the website – but only once.

gtag.js:

  • Direct deployment of the code into the HTML page – you insert the code directly.
  • Support only for Google services – Analytics, Ads, but not Facebook.
  • Every change requires editing the code on the website – you have to call a programmer.
  • Simpler implementation – one piece of code is enough.
  • Suitable for simple websites with minimal measurement – when you only need Google Analytics.

For most websites GTM is the better choice, especially if you plan to use several measurement codes or will need to change their settings often. gtag.js is suitable only for very simple cases where you need just basic Google Analytics and nothing more.

Client-Side vs. Server-Side Tagging (for Advanced Users)

In GTM there are two ways to implement measurement. Most people use the first, but it is good to know that a more advanced variant exists too.

Client-Side Tagging

  • Tags fire directly in the visitor's browser.
  • Simpler implementation – just put the GTM code on the website.
  • The standard approach, suitable for most websites.
  • Can be blocked by ad blockers or by some browsers.

Server-Side Tagging

  • Tags fire on your server, not in the visitor's browser.
  • Better website performance – less code is loaded in the browser.
  • Higher data security – sensitive data is not processed by the browser.
  • More complex implementation – requires setting up a server in Google Cloud.
  • Less prone to blocking by ad blockers.
  • Improves data quality and completeness – reduces information loss caused by cookie banners and ad blockers.
  • Increases the performance of advertising systems – thanks to more accurate data, advertising platforms can optimise campaigns better.
  • Improves attribution – you get a complete picture of the customer journey, which leads to better marketing decisions.

Server-side tagging is a more advanced solution for large websites with high traffic or companies with strict personal data protection requirements. For ordinary websites and e-shops standard client-side GTM is quite enough, and it is simpler and cheaper.

We offer full implementation of Google Tag Manager. We take care of the complete setup of the system and its maintenance, we will handle access, carry out further settings according to your needs and keep clear documentation. When a new person joins your team, they will be able to find their way around everything quickly. Fill in our contact form with no obligation and we will arrange a meeting where you explain your situation to us. We will prepare a solution exactly according to your needs and options.

Frequently Asked Questions

Is Google Tag Manager free?

Yes, the basic version of GTM is completely free and provides everything most websites need. There is also a paid version, Google Tag Manager 360, which offers advanced features for large companies.

Do I need to know JavaScript to work with GTM?

For basic work with GTM you do not need to know JavaScript. You can do most common tasks through the user interface. For working with the data layer or custom HTML tags, however, knowledge of JavaScript is an advantage.

Can I use GTM with any CMS?

Yes, you can use GTM with practically any CMS (WordPress, Joomla, Drupal, etc.) or e-commerce platform (WooCommerce, Shopify, Magento, etc.). For the most popular systems there are also plugins that make implementing GTM easier.

Will GTM slow down my website?

GTM is designed to minimise the impact on page load speed. The GTM code loads asynchronously (it does not block page loading) and lets you manage better when and how individual tags fire. In fact, in some cases GTM can even speed up a website, because it lets you optimise the loading of scripts better. Some scripts can be delayed or switched off entirely under certain conditions.

What if I already have measurement codes deployed on my website?

If you already have measurement codes deployed on your website (for example Google Analytics), it is recommended to migrate them to GTM first and only then remove the original codes. GTM lets you run measurement codes in parallel with those that are already on the website, which makes the transition easier.

How does GTM work with cookie and consent banners?

It is advisable to tie the inclusion of GTM on the website to the loading of the cookie banner. Our proven approach is that GTM loads after the library that makes up the banner has loaded. Not to be confused with loading after consent. GTM is therefore ready on the website at the moment the banner is ready too, and can track and react to interactions in it. After that, setting up the right consents is a trifle.

You might also be interested in: Cookie Tips from the Analyst Practice