What is Google Tag Manager and how to set it up

From installing the container to the first GA4 event, from preview to publishing with a version name, and who should get which access: the steps in order.

· 11 min readData

Short answer

Google Tag Manager is a Google tool for managing measurement tags from one panel without touching the site’s code each time. The container is installed on the site once; tags, triggers and variables are defined in the panel, tested in preview and published under a version name.

On Monday morning the sales team asks: how many people sent the quote form last week? GA4 has page views but no form submissions. Adding the event means opening a ticket for a developer, the ticket waits for the next release cycle, and the number arrives three weeks later. This is where the question of what Google Tag Manager is starts to matter: it is a Google tool that lets you add, test and roll back measurement tags from one panel without touching the site’s code each time. This article goes in order from installation to the first GA4 event and publishing.

You only need to learn the terms once. The glossary entry for Google Tag Manager gives a short summary; below we explain the same concepts from inside the work.

Four words: container, tag, trigger, variable

Tag Manager’s panel has four concepts, and they work together to carry an event on the site to GA4. The statements in the table are plain-language equivalents of the concepts; you can find the details in Google’s help pages.

Concept Which question does it answer? Example
Container Where do this site’s tags live? A box with an ID starting “GTM”, installed once on the site
Tag What is sent, and where to? A “generate_lead” event to GA4
Trigger When does the tag run? When the form is sent successfully
Variable With which value? Form ID, page URL

In short: the tag does the job, the trigger says when, the variable carries the value, and the container holds all three on the site. Every tag is attached to a trigger that says when it should run.

Setup: six steps in order

  1. Create the account and the container. Open an account at tagmanager.google.com and choose Web as the container type. Create the account with your business’s own Google account; the agency or freelancer is added later as a user. The access section below explains why.
  2. Add the container code to the site. In the workspace, click the container ID (it starts with GTM) or the “Install Tag Manager” card. If you use a site builder such as WordPress, Shopify or Wix, you can install it with the integration Google offers, without adding code by hand. If you install it manually, Google’s current instruction is to paste the first block of code as high in the <head> tag as possible. In older installations the code had two parts (the second went in <body>); Google says sites tagged with the older version do not need to be re-tagged. After adding it, type your site’s address into the same window and check it with “Test”.
  3. Add the GA4 tag. Your GA4 property and web data stream must be ready; if not, first complete the opening sections of the GA4 setup checklist. Then, following the instructions on Google’s GA4 setup page, add the Google tag with its tag ID. The tag must load from a single place on the site; if the same tag sits in the theme, in a plugin and in Tag Manager, everything is counted twice. The checklist covers this trap in detail.
  4. Set up the first event. A form submission or a button click; there are two examples below.
  5. Test in preview mode. Run it in your own browser while the change is not yet live.
  6. Publish with a version name. Save what changed in a name that tells you later.

The first three steps are done once; the last three repeat with every new tag.

The first event: a form submission or a click

Google’s GA4 events guide sets the logic out like this: you create a “Google Analytics: GA4 Event” tag, enter the measurement ID and an event name, then attach a trigger that says when the event should be sent. To use one of Google’s recommended event names, you pick from the predefined names; for a quote form, the name we also recommend in our checklist is “generate_lead” (see the note on event names). Gathering event names in a written measurement plan first stops the same action being counted under three different names.

Example 1: a form submission. Under Triggers, create a new Form Submission trigger, choose “Some Forms” and write the page that holds the form as the condition. According to Google’s help page, two options matter: with “Check Validation” on, the trigger fires only when the form is sent successfully; off, it fires every time a user tries to send. “Wait for Tags” delays the form until the tags have fired, before the next page loads. If your form redirects to a thank-you page, there is a sturdier route: run the tag with a Page View trigger tied to that thank-you page’s address. Do not trust the trigger until you have seen how it behaves on your own site’s form in preview.

Example 2: a button click. Choose All Elements as the trigger type, then “Some Clicks”, and write the condition; Google’s example is “Click Text” containing the button’s label. If the click text changes one day, the trigger breaks; for a lasting fix, ask the developer to give the button a fixed class or ID.

In both cases, save the tag and do not publish yet. Next comes preview.

In Tag Manager a click or form submission becomes a GA4 event: the trigger says when, the tag says what to send, the variable says with which value Visitor Sends the form Trigger Form submission, only if it succeeds Tag GA4 event tag: generate_lead GA4 The event shows up in reports Variables Form ID and page URL carry the values Test in preview mode first, then publish with a version name In Tag Manager a click or form submission becomes a GA4 event: the trigger says when, the tag says what to send, the variable says with which value Visitor Sends the form Trigger Form submission, only if it succeeds Tag GA4 event tag: generate_lead GA4 The event shows up in reports Variables Form ID and page URL carry the values Test in preview mode first, then publish with a version name
Figure: A visitor sends the form, the trigger checks the condition, the tag sends the event to GA4; variables carry values, and preview and a version name come before publishing.

Preview and publishing

Preview. The Preview button at the top right of the workspace opens Tag Assistant. Type your site’s address and press Connect; the site opens in a new window and connects to Tag Assistant. Send the form yourself or click the button yourself, then check in Tag Assistant whether the tag fired and with which trigger. If the tag shows as not fired, inspect the trigger condition first, then the values the variables received. Also check in DebugView or the Realtime report that the event reaches GA4 under the right name; the checklist goes into this second verification step as well.

Publishing. Press Submit at the top right, use the “Publish and Create Version” option, write a version name and description, glance through what you changed since the last version with “Activity History”, then press Publish. A version name is a note to your future self. Use short, dated names that say what you did, for example “GA4 form submission event, quote page”. When a number breaks three months from now, those names tell you which publish it broke after.

Every new tag you add to the container has to respect the visitor’s cookie choice. The consent mode settings, the difference between basic and advanced implementation and the legal framework are covered in the GA4 setup checklist. Here one rule is enough: test every new tag twice in preview, once by rejecting the cookie notice and once by accepting it. Do not publish until the tag behaves as you expect in both. For the notice text and legal assessment, work with a legal adviser.

Who should get which access?

Access in Tag Manager has two layers. At account level you are a user or an administrator; at container level you are given one of the read, edit, approve and publish permissions. The definitions on Google’s help page are as follows:

Container permission What can they do? Who is it for?
Read Sees tags, triggers and variables, cannot change them The marketing and management team that reads reports
Edit Creates workspaces and edits; cannot create versions or publish The practitioner at the agency, or a new team member
Approve Creates versions and edits; cannot publish The senior person who reviews changes
Publish Does everything, including publishing A small, named group of people

The practical meaning of this split is that the person who makes a change need not be the person who publishes it. Tiering permissions stops measurement being broken by accident.

Google’s warning on account ownership is clear: the person managing the account should be from inside your organisation, not an outside agency or consultant, and there should be at least two active administrators. With a single administrator, you may lose access to your tags when that person leaves. If you work with an agency, add the agency as a user and remove the permission when the work ends; the setup and the saved versions stay with you.

Common mistakes

  • The same GA4 tag sitting in both the theme and Tag Manager, so every page view is counted twice.
  • Publishing without previewing; a change you publish goes live on your site.
  • Leaving the version name empty or writing “update”.
  • Tying the form event to a button click; failed submissions get counted too. Use a successful-submission or thank-you-page trigger.
  • Opening the account under one person’s or an outside agency’s Google account.
  • Leaving the form trigger without a condition. For performance, Google recommends writing the place where the form is submitted (for example a specific address) as a condition.

Once the setup is done, the numbers can still differ between GA4 and the ad platform; we collected the reasons in why GA4 and ad platforms disagree. For a weekly reading routine, see the Monday report. If you want your tags to run on your own server instead of in the browser, what is server-side tagging covers the first steps. Tag Manager setup, the measurement plan and testing are part of our data and CRO service.

Common questions

Do I have to use Tag Manager for GA4?

No. You can add the GA4 tag straight to the site. On sites with several events, several ad tags and frequent changes, Tag Manager is tidier, because each change is tested in preview and saved as a version. Whichever you choose, the tag should load from a single place on the site.

I have the old, two-part Tag Manager code. Do I need to reinstall?

No. Google says sites tagged with the older version of the code do not need to be re-tagged and the container will keep working as it is. For new installations, only the current instruction applies.

What access should I give an agency?

Open the account yourself, add the agency as a user and give edit or approve permission on the container as needed. Agree from the start who gets publish permission. Keep the administrator accounts inside your organisation, and have at least two.

Here is one thing you can do today: in a browser, open a workspace in Tag Manager for your site, prepare just one event tag and run it in preview without publishing. If the event shows up in Tag Assistant, write the version name, and only then press Publish.

Sources

This article is general information, not legal, financial or technical advice. Platforms, their rules and the law change over time, so some details may have changed since 11 November 2026 or contain small errors. Before you make a decision for your business, check the current official sources or write to us.

Tell us about
your project.

Fill in the form or write to us directly, and we will agree on a day to talk.

Your first meeting is with Deniz Sezer, founder of Detmore.

First meeting free · Reply within one working day · Written proposal in 2 to 3 days · NDA ready

What do you need? pick as many as you like

Name, email and phone are required.

Contact

We reply within one working day.