Google Tag Manager Basics for Business Websites

Google Tag Manager lets you add and change analytics, advertising and other tracking code on your website from one place, without editing the site each time. This guide covers when you need it, accounts and containers, tags, triggers and variables, preview and publishing, consent settings and who should have access. It draws on Google's Tag Manager Help Center and developer documentation, checked on 3 November 2026.

What Tag Manager does

Google's introduction to Tag Manager calls it "a tag management system that allows you to set up and manage tags on your site without changing your website's code". A developer adds two snippets of code to each page once; after that, tags are set up "through the Google Tag Manager website".

A tag, in Google's words on tags, is code "provided by analytics, marketing, and support vendors to help you integrate their products into your websites": for example the Google Analytics or Google Ads tag, or a social network's pixel. A Tag Manager container "can replace all other manually-coded tags on a site", and Google's list of supported tags includes templates for many third-party products.

Do you need it?

Not always. Google's comparison of Tag Manager and gtag.js says the Google tag on its own can measure "page views, clicks, scrolls, and more" in Google Analytics and key events in Google Ads, and is "great for marketers who don't have a web development team readily available". If you only need those defaults, "you can set up the Google tag once and you're all set".

Tag Manager adds:

  • it can send data to "Google tags, third party tags, and custom tags", while the Google tag "can only send data to Google services";
  • tags can be added and changed "without editing code";
  • it has workspaces and version control for teams.

So Tag Manager earns its place when several tools need tracking. Either way, install each tool once: our GA4 basics guide explains why installing Analytics twice counts every visit twice.

Accounts and containers

Google's setup guide, create an account and container, sets out the structure: a Tag Manager account "represents the topmost level of organization for your company", with "one Tag Manager container for each of your company's websites and apps".

Google's considerations before you install add:

  • The business creates the account. "If an agency manages tags on behalf of your company, then your company should create the Tag Manager account and add the agency's Google account as a user."
  • One container per domain is the usual practice, but if the visitor's journey spans several domains, one container can serve them all. "When someone publishes a container, all changes go live, regardless of domain."
  • Start with a plan. Google recommends starting "with an analytics strategy and tag implementation plan".

To install a web container, the first snippet goes "as high in the <head> tag as possible" and the second "immediately after the opening <body> tag", on every page.

Tags, triggers and variables

A container has three parts:

  • Tags are what runs: the Analytics tag, a conversion tag, a pixel.
  • Triggers decide when. Google's page about triggers says a trigger "listens to your web page or mobile app for certain types of events like form submissions, button clicks, or page views", and "every tag must have at least one trigger in order to fire".
  • Variables hold values that tags and triggers use, such as the page address or the text of a clicked button. Google's list of built-in variables covers clicks, forms, pages, scrolling and errors.

A common example for a service business: a Google Ads conversion tag, fired by a trigger on the thank-you page that appears after an enquiry form is sent. Our guide to Google Ads basics covers why conversion tracking matters.

One caution on custom code. Tag Manager can run "Custom HTML" tags, which are any code someone pastes in. Google's page on malware detection says containers are scanned, and that "the best way to avoid malware issues is to use the tag templates built into Google Tag Manager". Treat every Custom HTML tag as code running on your site, and know who added it and why.

The data layer

When tags need business details, such as which service was enquired about, the developer passes them through the data layer. Google's developer guide to the data layer describes it as "an object used by Google Tag Manager and gtag.js to pass information to tags".

In practice, the data layer is the agreement between your developer and whoever manages tags. Write down each event and value it carries, so a redesign does not break tracking without anyone noticing.

Preview, publish and versions

Changes in Tag Manager are drafts until they are published. Google's page on preview and debug explains that preview mode lets you "browse a site on which your container code is implemented as if the current container draft was deployed". It connects to Tag Assistant, which shows "which tags fired and in which order", and the debug view "is not visible to your regular website visitors".

Publishing is covered on Google's page about publishing, versions and approvals:

  • "Every time a container is published, a version of that container is recorded", and "a version is a snapshot of a container configuration at a particular time".
  • If something goes wrong, you can return to an earlier version and publish it.
  • Tag Manager keeps a publish history showing "when versions were live and who published them".

A good habit: preview every change, publish with a descriptive name, then check the live site and your reports the next day.

Where privacy law requires consent, tags must respect the visitor's choice. Our guide to cookie consent banners covers the banner, Google's consent mode and its basic and advanced versions. Inside Tag Manager, Google's page on consent mode support describes three features:

  • The Consent Initialization trigger, for tags that set or update consent, such as your consent tool. It "will always fire before all other tags".
  • Consent settings on each tag. Google tags have "built-in consent checks"; for other tags you can choose "Require additional consent for tag to fire", so the tag runs only if the consent types you name are "granted".
  • The Consent Overview page, which gives "a high level view of all the consent settings across the tags in your container".

Google's developer guide to setting up consent mode says that if you use Tag Manager and your own banner, "the recommended approach is loading your banner through the Tag Manager container", using a consent mode template.

Who gets access

Google's page on users and permissions describes two levels. At the account level, a user is either User or Administrator. For each container, a user has one of:

  • No access or Read: can browse but not change anything;
  • Edit: can make changes "but not create versions or publish";
  • Approve: can also create versions, but not publish;
  • Publish: full rights, including publishing.

Google recommends "at least two active administrator accounts" and making sure "your account is managed by someone in your organization, not an external agency". Give an agency Edit or Publish on the container it works on, not Administrator. Our guide to what you should own covers the other accounts behind your site.

A checklist

  • You have decided between the Google tag alone and Tag Manager, and each tool is installed once.
  • The Tag Manager account was created by your business, with two administrators from it.
  • There is a written list of tags, what triggers each and why it is there.
  • Built-in templates are used where they exist; every Custom HTML tag has a known owner.
  • Data layer events and values are documented with the developer.
  • Every change is previewed and published as a named version.
  • Every tag has a consent setting, checked in the Consent Overview.
  • Agencies and freelancers have container access only, removed when the work ends.

Frequently asked questions

What is Google Tag Manager?

A free Google tool for adding and managing tracking and marketing code, called tags, on a website from one web interface. A developer installs two snippets once; after that, tags can be added, changed and published in Tag Manager without editing the site.

Do I need Tag Manager if I only use Google Analytics?

Not necessarily. Google says the Google tag on its own measures page views, clicks, scrolls and more, and suits sites without a developer on hand. Tag Manager helps when you run several tools, third-party tags or custom tracking.

What is the difference between a tag, a trigger and a variable?

A tag is the code that runs, such as the Analytics tag. A trigger decides when it runs, such as on a page view or form submission. A variable holds a value they use, such as the page address or the clicked button's text.

Can I undo a change in Tag Manager?

Yes. Every publish records a version, and you can return to an earlier version and publish it again. Preview mode lets you test a change on your own browser before anyone else sees it.

Should my agency own our Tag Manager account?

No. Google recommends that the business creates the account and adds the agency as a user, with at least two administrators from your own organisation. Give the agency container access and remove it when the work ends.

Planning a new website? Whoever builds it, the domain and your content should always be in your name, and our projects end with a short handover so your team can edit content. See our website development service and all our services, or email [email protected].