Start a project

Google Tag Manager: what it is and how to set up tags properly

Google Tag Manager: what it is and how to set up tags properly

Google Tag Manager (GTM) is a free Google tool that keeps every measurement code on your site in one place: GA4, Google Ads conversions, the Meta Pixel and anything else you need. You add one snippet to the site once. After that, you add and change tags inside GTM, without opening the theme for every change.

This guide explains how tags, triggers and variables work, how to set up GA4 and conversions, what consent mode asks for and which mistakes ruin your numbers. Plenty of people look for this: «google tag manager» gets 2,900 searches a month in Greece (Google Keyword Planner, November 2026).

What Google Tag Manager does

Every measurement or advertising tool gives you a piece of code, the tag. Without GTM, each tag is pasted by hand into the site’s code. Within a year nobody remembers which snippet measures what.

With GTM everything lives in one container. A developer adds the container code once. From then on, the marketing team can set up a new event in a few minutes and publish it when it is ready.

GTM moves data. Storage and reporting happen in the tools that receive it, such as GA4 and Google Ads. Using it costs nothing. For large organisations Google also offers a paid version, Tag Manager 360.

When the Google tag is enough without GTM

If the site only needs basic GA4, the Google tag or a plugin such as Site Kit for WordPress will do. GTM pays off as soon as you add ad conversions, a second tool or events beyond page views. In practice that covers almost every business that advertises.

Containers, tags, triggers and variables

The container is your site’s «box»: a collection of tags, triggers, variables and settings. GTM offers containers for Web, iOS, Android, AMP and Server. A normal website needs one Web container.

Above the container sits the account. Create it with a company email address and give partners access as users. If you change agency, the measurement stays yours.

ElementWhat it doesExample
TagThe code that runs and sends data to a toolGA4 event, Google Ads Conversion Tracking, Meta Pixel
TriggerDecides when a tag runsThank-you page view, click on the phone number, form submission
VariableA value that tags and triggers readPage URL, button text, order value

What the dataLayer is

The dataLayer is how the site «talks» to GTM. When an order is completed, the shop writes the amount, the products and the order number to the dataLayer. GTM reads them as variables and sends them to GA4 and Google Ads.

In WooCommerce this is done with a plugin or a little custom code. On custom platforms the developer builds it. Without a dataLayer you learn that a purchase happened, but not how much money it brought in.

How to set up Google Tag Manager step by step

  1. Create an account and a Web container at tagmanager.google.com with the company email address.
  2. Add the container’s two snippets to the site: the first high in the head, the second right after the opening of the body.
  3. Remove any GA4 or Pixel code that was added directly to the theme or through plugins. Otherwise you will count everything twice.
  4. Add the Google tag with your GA4 Tag ID, which starts with «G-».
  5. Set up the events and conversions you care about.
  6. Check everything in Preview.
  7. Click Submit and give the version a name and a description.

Preview and versions

Preview opens the site as if the draft had been published. In Tag Assistant you see which tags fired, in what order and with which values. Visitors see none of this.

Every publish is kept as a version. If something breaks, you go back to the previous one in two clicks. So write down in the description what you changed and why.

GA4 through Google Tag Manager

The foundation is a Google tag with your GA4 Tag ID that fires on every page. It measures page views and whatever GA4 records automatically, such as scrolls and clicks to other sites.

The events that matter to the business you set up yourself. The most common:

  • generate_lead when a form is submitted successfully.
  • Clicks on a phone or email link.
  • purchase in the shop, with value, currency and order number from the dataLayer.
  • Downloads of a catalogue or price list in PDF.

In GA4 you mark the important events as key events, so they show up as results in your reports. How to read the numbers afterwards is covered in our guide to Google Analytics 4.

Google Ads conversions and the Meta Pixel

For Google Ads you use the Google Ads Conversion Tracking tag. It needs the account’s Conversion ID and the Conversion Label of each conversion. You find both in Google Ads, in the conversion’s settings, under «Use Google Tag Manager».

For purchases, also fill in value, currency and Transaction ID. Without a Transaction ID, a refresh of the thank-you page can count the same order twice. Accurate measurement also changes your cost per result, as we explain in our article on what Google advertising costs.

You also need the Conversion Linker. It stores the click information in first-party cookies on your own domain, so the conversion can be tied to the ad that brought it. It goes on every page. According to Google, if a Google tag already loads everywhere, a separate Conversion Linker is not needed.

The Meta Pixel goes in with a template from GTM’s Community Template Gallery or with a Custom HTML tag. Meta also offers the Conversions API, which sends the same events from the server and fills in what the browser loses. We cover it in detail in our guide to Meta Ads.

Consent mode and the cookie banner

In Europe, analytics and advertising cookies need the visitor’s consent. Consent mode is how the cookie banner tells Google’s tags what the visitor allowed. There are four main consent types:

  • analytics_storage: analytics cookies, for example GA4’s.
  • ad_storage: advertising cookies.
  • ad_user_data: sending user data to Google for advertising.
  • ad_personalization: personalised advertising, such as remarketing.

Google asks anyone advertising to users in the European Economic Area to follow its consent policy for personalisation and measurement to work. ad_user_data and ad_personalization were added to consent mode as part of that policy.

Basic or advanced consent mode

In basic mode, Google’s tags wait for the visitor to answer the banner. If they decline, no data is sent to Google. In advanced mode, the tags load with consent denied by default and send cookieless measurements until consent is given.

Advanced mode gives Google more signals to model the conversions you lose. The choice has a legal side too, so discuss it with whoever is responsible for personal data in your business.

Third-party tags: Meta Pixel, Hotjar and others

Consent mode covers Google’s tags. The Meta Pixel, Hotjar or a chat widget do not read it. For those, you set in GTM that they need a specific consent before they fire.

The banner itself goes in with a Consent Initialization trigger, so it loads before any other tag. Finally, check in Preview that no measurement cookies are written before the visitor accepts.

The mistakes we see most often

  • Double counting. GA4 sits both in the theme and in GTM. Page views double and the rates look odd.
  • Conversion on click. The tag fires when someone clicks «Send», so it also counts forms that failed. Measure the successful submission.
  • Purchases without an order number. Every refresh of the thank-you page records a new sale.
  • Container on a contractor’s email. When the contractor leaves, so does your access.
  • Tags without a consent check. A compliance risk.
  • Tags nobody remembers. Pixels from campaigns that ended years ago weigh the page down. See what they do to speed in our guide to PageSpeed and Core Web Vitals.
  • Publishing without Preview. One wrong trigger can stop measurement for days before anyone notices.

A good habit is to review the container every few months. Delete what is no longer used and compare GA4 conversions with your real orders. For organic search, complete the picture with Google Search Console.

Server-side tagging: when it is worth it

The Server container runs in your own cloud environment and receives the data before passing it on to the tools. It gives you more control over what leaves the site, but it needs a server and maintenance. It makes sense for high-traffic sites or serious ad budgets. For most businesses a clean Web container is enough.

Frequently asked questions

Is Google Tag Manager free?

Yes. Google offers it for free. There is also Tag Manager 360, a paid version for large organisations.

What is the difference between Google Tag Manager and Google Analytics?

GTM installs and manages tags. Google Analytics receives the data and shows you reports. They usually work together: GTM sends the events and GA4 measures them.

Does Google Tag Manager slow down my site?

The container code itself is light. The weight comes from the tags it loads. A few clean tags with the right triggers will not show up in your speed. Dozens of forgotten pixels will.

Do I need a developer for Google Tag Manager?

For basic GA4 and conversions on thank-you pages, no. For a shop’s dataLayer or for server-side tagging, yes.

At MINOANDESIGN, as a Google Partner and Facebook Marketing Partner, we set up measurement before the first campaign goes live. See how we run Google and social media advertising or write to us at [email protected].

Have a project in mind?

Tell us where you want to go. We design, build, host and grow websites that perform.