# Google Tag Manager

Category: [Analytics & Measurement](https://seo-geo-glossary.com/en/glossary/category/analytics-measurement/) › [Tracking & consent](https://seo-geo-glossary.com/en/glossary/category/analytics-measurement/tracking-consent/)

**Google Tag Manager** (GTM) is a tag management system. It lets you set up and manage tags such as analytics or ad tracking on a website without changing the site's code each time. For SEO it matters as a measurement tool and as a possible source of errors.

## How does Google Tag Manager work?

You add two code snippets to your pages once. Everything else is configured in the GTM web interface. Four building blocks work together.

- **Container** holds all tags, triggers and variables for a site or app.
- **Tags** are the managed code snippets, for example a Google Analytics measurement.
- **Triggers** are conditions that make a tag fire when certain events occur.
- **Variables** supply values that tags and triggers use.

GTM manages tag deployment. Google Analytics is a separate product that reports the data.

## The data layer

The data layer is an object that GTM uses to pass information to tags. Your site can push an event into it, and a trigger in the container reacts to that event.

## What it means for SEO

GTM is often used to set up measurement such as key events in Google Analytics without a code release, which supports conversion tracking and reporting.

It can also output page elements through JavaScript. Google can process titles and canonical tags set that way, but advises against changing the canonical URL via JavaScript to something other than the one given in the original HTML. A noindex in the HTML may stop Google from rendering the page, so removing it with JavaScript may not work. SEO-relevant elements are safer in the delivered HTML (assessment).

Tests by searchVIU (2017) checked which page elements Google picks up when they are injected through GTM. Google processed hreflang, canonical and `noindex` tags, titles, meta descriptions and internal links. Google itself still names the served HTML as the best place for the canonical and doesn't recommend setting it with JavaScript.

## Consent

GTM supports consent mode with four consent types: `ad_storage`, `analytics_storage`, `ad_user_data` and `ad_personalization`. A Consent Initialization trigger makes sure consent settings are applied before other triggers fire.

## Example

A form pushes an event to the data layer when it is submitted.

```
window.dataLayer = window.dataLayer || [];
dataLayer.push({'event': 'form_submitted'});
```

A trigger in GTM listens for `form_submitted` and fires a tag that sends the measurement to Google Analytics.

## FAQ

**What does Google Tag Manager do?**
It deploys and manages tags on a website from a web interface instead of the site's source code.

**Is Google Tag Manager the same as Google Analytics?**
No. GTM delivers tags. Analytics collects and reports the data.

## Related terms

- [Google Analytics 4 (GA4)](https://seo-geo-glossary.com/en/glossary/google-analytics-4/index.md)
- [Consent Mode](https://seo-geo-glossary.com/en/glossary/consent-mode/index.md)
- [Canonical tag](https://seo-geo-glossary.com/en/glossary/canonical-tag/index.md)
- [JavaScript SEO](https://seo-geo-glossary.com/en/glossary/javascript-seo/index.md)
- [Rendering](https://seo-geo-glossary.com/en/glossary/rendering/index.md)

## More on the searchVIU blog

- [More JavaScript SEO experiments with Google Tag Manager](https://www.searchviu.com/en/javascript-seo-experiments-google-tag-manager/)
- [How to implement hreflang with Google Tag Manager](https://www.searchviu.com/en/hreflang-google-tag-manager/)
- [JavaScript SEO surprise! Google DOES use JS-injected canonical tags.](https://www.searchviu.com/en/javascript-canonical-tags/)

## Sources

- [About Tag Manager – Tag Manager Help](https://support.google.com/tagmanager/answer/6102821?hl=en)
- [Consent mode in Tag Manager – Tag Manager Help](https://support.google.com/tagmanager/answer/10718549?hl=en)
- [The data layer – Tag Platform documentation](https://developers.google.com/tag-platform/tag-manager/datalayer)
- [JavaScript SEO basics – Google Search Central](https://developers.google.com/search/docs/crawling-indexing/javascript/javascript-seo-basics)
- [Google Tag Manager – Semrush Blog (secondary)](https://www.semrush.com/blog/google-tag-manager/)
- [More JavaScript SEO experiments with Google Tag Manager – searchVIU blog (2017)](https://www.searchviu.com/en/javascript-seo-experiments-google-tag-manager/)
- [How to implement hreflang with Google Tag Manager – searchVIU blog (2017)](https://www.searchviu.com/en/hreflang-google-tag-manager/)

---

Last updated: October 8, 2026
URL: https://seo-geo-glossary.com/en/glossary/google-tag-manager/
