Skip to content
Free AI visibility check: does your brand show up in ChatGPT and Gemini answers?Apply →

What Is Google Tag Manager? From the Container Snippet to Server-Side Tagging

Google Tag Manager edits tracking tags without touching site code.

AuthorMahmud FiloğluReviewed byLast updated: View as Markdown
Cover of the article What Is Google Tag Manager: the Google Tag Manager logo and the word server-side

What Is Google Tag Manager?

What is Google Tag Manager? It is a tag management system (GTM) that lets you set up and manage tags on your site without changing your website's code 1 . A tag here is a piece of measurement or marketing code: an analytics page view, an ads conversion, a partner pixel. Instead of sitting in the page template and waiting for a release, tags live in one place and are published from a web interface 14 .

Definition. Google Tag Manager is a tag management system, so tags are set up and managed without editing the site's code 1 . The tags, triggers, variables and related configurations installed on one website or mobile app together form a container 1 . One container can take over every tag that used to be hard-coded into the site or app: Google Ads, Google Analytics, Floodlight and third-party tags alike 1 .

What a Tag Manager container is

The container is the unit you actually work in 1 . One container covers a whole site, and you do not need a container for each page of your website 2 . The container types on offer are Web, iOS, Android, AMP and Server 2 . Web is the most common; the Server type exists for a website that uses server-side Tag Manager 2 . Above the container sits the account, and one Tag Manager account per company or organization is typically enough 1 .

What people use Google Tag Manager for

The everyday job is small and constant: Tag Manager deploys and modifies tags without editing code, both from Google and from third parties 14 . Tag Manager supports tags for Google products and third-party tags 15 , so one container can hold an analytics tag, a conversion tag and a partner pixel at once. After the code is on the site, tags are managed without needing to update your code any further 15 .

How widely is Google Tag Manager used?

In the W3Techs reading of 3 October 2026, Google Tag Manager is used by 45.1% of all websites 19 , while 54.7% of websites use none of the tag managers W3Techs monitors 19 . Among the sites that do run one, Google Tag Manager holds a tag manager market share of 99.6% 19 . Those last two figures come from different denominators - all websites versus the tag manager market - so they do not belong on the same chart.

How Does Google Tag Manager Work? Tags, Triggers, Variables and the Data Layer

A tag fires when a trigger's condition is met, and variables supply the details the tag needs. Google's own description ties the three together: tags are configured in the interface, triggers cause a tag to fire when certain events occur, and variables simplify and automate the tag configuration 1 .

How a tag fires in Google Tag Manager

  • Visitor interacts with the page - a click, a form submission, a page view.
  • Data layer stores the interaction - it is the JavaScript object that briefly holds user-interaction data 5 .
  • Trigger condition is met, and the trigger tells the tag to fire 1 .
  • Tag reads its variables, which is what Data Layer variables are for 5 .
  • Tag sends the event onward - in a client-side setup, straight from the browser or device 4 .

Tags, triggers and variables

Triggers are conditions, not schedules: they cause a tag to fire when certain events occur. Variables are the reusable parts, and they exist to simplify and automate tag configuration, so one tag can behave differently on different pages without being rewritten 1 . This is the mechanism behind the promise in the definition - a container absorbs the tags the template used to carry 1 , because the logic that decided when they ran now sits in the trigger.

What the data layer does

The data layer is the JavaScript object that briefly holds data about what the visitor did on the page or in the app 5 . Data Layer variables read that stored data and make it usable inside your tags 5 . Without it, tags have to scrape values out of the rendered page; with it, the site states what happened in a structured way.

By default this whole chain is client-side. When the user performs an action that triggers a tag, the event data leaves the browser or device as one or more HTTP requests aimed at Google products or advertising partners 4 . That default is what server-side tagging changes later in this article.

Google Tag Manager vs Google Analytics: Which One Does What

These two are not rivals. Google Analytics 4 is the measurement product that replaced Universal Analytics 13 ; Google Tag Manager is the system that manages the tags feeding it. The Google tag sends data to Google Ads and Google Analytics 4, also called destinations 14 , and you can use the Google tag on its own or with Tag Manager 14 . So the real question is not which product wins, but whether your tags need a container around them.

The Google tag (gtag.js) or Tag Manager?

Google calls the Google tag the basis for all measurement use-cases 14 . The Google tag alone is enough when only the default metrics are needed, such as page views, clicks and scrolls 14 . A container earns its place when tags beyond Google's own are managed: one container carries Google's tags and everyone else's side by side 15 , and it deploys and modifies tags without editing code 14 .

Google tag (gtag.js) and Google Tag Manager, side by side

Cost is not the tie-breaker: Google's own comparison table lists the cost of the Google tag as Free and the cost of Google Tag Manager as Free 14 . Nor is the choice permanent. In a container setup the Google tag is set up in the container and fired with the Initialization - All pages trigger 15 , and the container can take over the tags that were hard-coded before 1 .

The decision is therefore about scope, not about budget or lock-in. A separate guide to Google Ads costs and setup covers the spend side once those conversion tags are firing.

Universal Analytics is no longer an option

Google Analytics 4 has replaced Universal Analytics 13 . Starting the week of July 1, 2024, access to current and historical Universal Analytics data ended, and most users lost access to the interface and the API on that date 13 . Universal Analytics goals and ecommerce transactions stopped measuring new conversions, including those within linked advertising accounts 13 .

An account still works, but after July 1 it shows only GA4 properties 13 . The English version of Google's migration document carries a last-updated date of July 16, 2025 13 , which is worth noting because the localized versions of Google's help pages do not always carry the same date or the same wording.

How to Set Up Google Tag Manager

Setup has three parts: an account, a container, and the container code on the page. Create a Tag Manager account first, since it is the topmost level of organization for the company, then one container for each website and app 2 . The account form also asks you to select the country location for the account 2 . One prerequisite decides how the rest goes: you must be able to access the code for your website 3 .

Account, container and the container code

A single container serves every page on the domain 2 ; there is no per-page setup to repeat. Once those snippets are in place the code stops being part of the workflow: tags are added and edited inside Tag Manager, with no further updates to the site 15 . The first tag most teams add is the Google tag itself, which in the container is set up with the Initialization - All pages trigger 15 .

Where the two snippets go

To use Tag Manager you add 2 snippets of code to each page of your website 1 . Paste the first block as high inside the <head> tag as possible 3 , and the second immediately after the opening <body> tag 3 . The positions are not decorative: the first snippet has to be running before the tags it is supposed to control.

If you use WordPress, Shopify or Wix

If your website is built using a website builder or content management system like WordPress, Shopify or Wix, you can set up the Google tag with an integration that does not require you to update the code on each page of your website 3 . That route removes the code-access prerequisite for most teams, which is why the platform question comes before the tagging plan. Whoever owns the container should also sit close to the ad accounts, whether that is an in-house analyst or a Google Ads agency .

Before You Publish: Preview Mode and Tag Assistant

Preview and debug mode loads your own site as though the current container draft had already gone out, which is how a configuration is tested before it is published 6 . In Google's own setup flow this is a separate step that comes first: make sure the tags behave as intended, then publish the changes 16 .

What preview and debug mode shows you

In the Workspace tab, Preview launches Google Tag Assistant in a new tab 6 . The previewed session connects to Tag Assistant, where you can see which tags fired and in which order 6 . The debug interface shows up only in the browser that enabled preview mode, or for shared users; regular website visitors never see it 6 . An older container version can be opened in preview the same way 6 . This is the moment to check that the events behind your key performance indicators actually arrive.

What Tag Assistant is

Tag Assistant is a Chrome extension from Google, built for troubleshooting Tag Manager and Google tag implementations 8 . It is the same tool preview mode opens from the Workspace tab 6 , so the debugging surface is one surface rather than two.

Versions, Publishing and How to Roll Back a Mistake

A container published too early is fixed by going backwards. If a container version goes out before it is ready for production, the workspace can be reverted to an earlier version and published again 7 . That is the safety net most teams never read about until they need it.

A version is a snapshot of a container configuration at a particular time 7 . Every time a container is published, a version of that container is recorded 7 , so the rollback point is created whether or not anyone remembers to create one. Tag Manager also maintains a publish history, so you can see which versions went out and who published them 7 . That history turns "something broke last Tuesday" into a specific change with a name against it.

Work can also be frozen without going out: to save the changes without publishing them, select Create Version instead 16 . Users with Approve access or higher can create versions 7 , which is a permission question worth settling before a large tagging project rather than during one.

Google's consent mode v2 guidance addresses one audience: customers of its online and offline solutions who receive data from end users in the European Economic Area (EEA) 11 . Where an EEA visitor is measured with Google tags, their consent choices have to be passed through to Google rather than stopping at the banner 11 . For EEA traffic, advertisers must adhere to the EU user consent policy to use ad personalization and for measurement 11 .

Who this applies to

A site in the EEA that maintains its own consent banner is told to implement consent mode v2 11 . There is an exception. Sites already using consent mode that run no personalized advertising, remarketing included, have nothing further to do for EEA traffic 11 .

Underneath all of it sits an older rule. Under the ePrivacy Directive, storing information, or gaining access to information already stored, in a user's terminal equipment is allowed only on condition that the user has given consent after being provided with clear and comprehensive information 20 . Technical storage or access strictly necessary to provide a service the user explicitly requested is exempt from that condition 20 . This is a description of the rule, not legal advice.

Consent mode was updated in November, 2023 and now contains two additional parameters 12 - that update is what "v2" refers to. ad_storage enables storage, such as cookies, related to advertising 10 . analytics_storage enables storage, such as cookies, related to analytics 10 . ad_user_data is listed for enhanced conversions and tag-based conversion tracking 10 . ad_personalization is named as the fourth parameter that can be defaulted to denied, alongside ad_storage, ad_user_data and analytics_storage 12 .

The four consent mode v2 parameters

Two defaults matter more than the parameter names. By default, no consent mode values are set, so a default value must be set for each consent type you are using 12 . And Google calls it best practice to scope those defaults to the regions where consent banners are actually shown 12 . Consent mode itself can be implemented in a basic or advanced way 12 .

Each web container includes a Consent Initialization - All Pages trigger by default 10 , and that trigger always fires before all other tags, including any Initialization triggers 10 . A tag can then be set to fire only if the status of all specified consent types is granted when the tag is triggered 10 . For teams that keep their own banner, Google's recommendation is to load that banner through the Tag Manager container itself 12 .

One warning points the other way. Blocking Google tags entirely until the visitor touches the banner stops Google verifying the consent choices, and Google says this may cost you data on EEA traffic 11 . Blocking everything is not the safe option it looks like.

Server-Side Tagging: What Changes When the Container Runs on a Server

Server-side tagging uses two containers: a web container that resides on the website or app, and a server container that resides in a cloud environment 4 . The web container's job does not change. What changes is where the second hop happens and who owns the machine it happens on.

Two containers instead of one

A server container doesn't run in the user's browser or on their phone; it runs on a server that you control 21 . That server sits in your own Google Cloud Platform project, or in another environment you pick, and nobody outside your side of the wire can read the data there until you forward it 21 . It exists to put an intermediary endpoint you own between the browser or device where events happen and the third-party endpoints 4 .

The modeling work carries over, because server containers use the same tag, trigger and variable model that you're used to 21 . The traffic shape changes though: in a client-side setup the event data leaves the browser or device in one or more HTTP requests 4 , while with server-side tagging the client issues only one HTTP request per event, addressed to the server container 4 .

What Google says it changes

Google names three key benefits. A lighter client processing load, improving website and app performance; the ability to screen and modify incoming requests to ensure data privacy; and the ability to validate and normalize data, improving data quality 4 .

Google's container guidance adds two more. Page speed improves as the amount of third-party code loaded in the user's browser is greatly reduced 9 , and cookies gain durability and security when your own domain sets them instead of the JavaScript on the page 9 .

Configure the server container to operate in a first-party context and the site's data and cookies stay inside your domain 4 . The operational cost is real as well: if you're using multiple containers, you must initialize consent in each container 4 , and the container itself has to be created as a Server type in the first place 2 .

Setting up server-side Google Tag Manager is part of roicool's new service line 22 .

The Drawbacks and Limits of Google Tag Manager

The two prerequisites named in the setup and server-side sections are also Tag Manager's two hard limits. Someone has to reach the site's source at least once 3 , and consent has to be started separately inside every container you run 4 . Neither is a defect; both are what the architecture costs, and both are easier to price in before a tagging project than during one.

Does Tag Manager slow a site down?

Google answers this in both directions on the same page. To keep page loading fast, it recommends using a tag manager such as Google Tag Manager 18 , and notes that tags can fire asynchronously instead of blocking one another, which cuts the number of network calls the browser needs to execute tags 18 . The same document then warns that although tag managers are designed to streamline page loading, using them carelessly can slow it down instead 18 .

The named mechanism is volume: too many tags and auto-event listeners in the container push the browser into more network requests than it would otherwise need 18 . The Web Almanac's third-party chapter observes the same thing from outside - tag manager scripts tend to load many other scripts and initiate many tasks 17 .

No primary source used here publishes a millisecond figure for the effect, so the honest answer is that it depends on what is inside the container. The metric to watch is page load time , not a number Tag Manager reports.

Container housekeeping

Tag Manager does report one number, and it is easy to misread. If the Size indicator value is above 70%, you should take steps to optimize your container configuration 9 . That 70% threshold measures container configuration size, not page speed 9 ; the two are regularly confused.

Google also advises avoiding static JavaScript inside Tag Manager, because static JavaScript is more efficiently served in an external file where a CDN can serve it and the browser can cache it 9 . And a tag, trigger or variable that is never used is simply taking up container space 9 .

Frequently asked questions

What is Google Tag Manager used for?

Google Tag Manager is used to deploy and modify tags without editing code, including the tags that would otherwise be hard-coded: Google Ads, Google Analytics, Floodlight and third-party tags. Tag Manager supports tags for Google products and third-party tags, so one container can hold an analytics tag, a conversion tag and a partner pixel together. After the code is on the site, tags are managed without further code updates.

Is Google Tag Manager free?

Yes - Google's own comparison table lists the cost of the Google tag and the cost of Google Tag Manager as Free. Server-side tagging is where the cost question changes shape: the server runs in your own Google Cloud Platform project, or in a different environment of your choosing, which is infrastructure you provide. Google's documentation does not attach a price to it.

What is a Google Tag Manager container?

A container is the collection of tags, triggers, variables and related configurations installed on a given website or mobile app. One container covers the whole site, and you do not need a container for each page. The container types are Web, iOS, Android, AMP and Server. Web is the common choice, and Server is for a website that uses server-side Tag Manager.

What is the Google Tag Manager code and where does it go?

The Google Tag Manager code is the 2 snippets that go on each page of the site. Paste the first block as high inside the <head> tag as possible; the second goes immediately after the opening <body> tag. Doing this yourself means you must be able to access the code for your website, which is the one real prerequisite.

How do I install Google Tag Manager on WordPress?

Install Google Tag Manager on WordPress with an integration instead of editing theme files. Site builders and content management systems, WordPress, Shopify and Wix among them, can carry the Google tag without any per-page code change. That route replaces editing every template by hand, which otherwise requires access to the code for your website.

How does Google Tag Manager handle cookie consent?

Through consent mode: tags read the consent state before they fire. Each web container includes a Consent Initialization - All Pages trigger by default, and it always fires before all other tags. A tag can be set to fire only when all specified consent types are granted. ad_storage covers storage such as cookies related to advertising. For end users in the European Economic Area (EEA), consent choices must be passed to Google.

Resources

October 3, 2026

About the author

Senior Software Engineer & Tech Lead

Semih Bayindir , with advanced technical expertise, strong experience in software architecture and modern development technologies Senior Software Engineer & Tech Lead is. Scalable systems demonstrate high competence in code quality, performance optimization and technical strategy determination.

All their posts

The service this post relates toGA4 consultingA GA4 and Google Tag Manager audit or a fresh setup: measurement plan, key events, settings and training for your team.

More posts

All Analytics and Data posts

Let’s put what you read to work for you.

In a 30-minute intro we look at your account and tell you which step should come first.