How to Set Up Google Tag Manager: A Step-by-Step Guide for Marketers

A six-step Google Tag Manager setup for marketers: account and container, snippet install, the Google tag, Preview testing, publishing and permissions.

A man's hand rests on a laptop keyboard beside a white wireless mouse on a grey desk, with his denim shirt sleeve blurred in the foreground.
Photo: Danial Igdery via Unsplash

Key Takeaways

Google Tag Manager is a free Google tool that lets marketers add and change website tags without editing code for every change. Setup runs in six steps, from creating an account and container to testing in Preview and publishing a named version.

  • Create one account per company and one container per website.
  • The current web snippet goes as high in the head as possible.
  • The Google tag should fire on the Initialization - All Pages trigger.
  • Preview mode opens Tag Assistant so you can test before publishing.
  • Only users with Publish permission can push changes live.

What Google Tag Manager does

Tags, triggers and variables

Google Tag Manager lets you configure and deploy tags from Google products and third parties, and Google offers it for free. A tag is the code that sends data to a tool such as Google Analytics, Google Ads or an ad platform pixel.

Tags fire when a trigger detects an event, such as a form submission or a video play. Variables hold values that tags and triggers reuse, such as a page URL or a click ID.

When the Google tag alone is enough

Google says it has upgraded the Google tag (gtag.js) to include Tag Manager features such as debugging and version control. If you only need default metrics like page views, clicks and scrolls, Google says you can install the Google tag once and stop there.

Tag Manager earns its place when you run several tools, custom events or frequent campaign changes. It also pairs well with consistent UTM parameters in GA4, because both keep tracking rules out of the page code.

What you need before starting

You need a Google Account, access to your site's code or CMS, and the tag IDs for the tools you plan to connect. Google also recommends starting with an analytics strategy and a tag implementation plan before you install anything.

Step 1: create an account and container

Account setup

Go to tagmanager.google.com, open the Accounts tab and select Create Account. Enter an account name and country, and decide whether to share anonymous data with Google for benchmarking.

Google treats the account as the topmost level for your company. If an agency manages your tags, Google advises that your company creates the account and adds the agency as a user.

Container setup

Name the container after the top-most URL of the site, such as www.example.com. You do not need a container for each page.

Tag Manager offers five container types:

  • Web, the most common choice, for websites and web apps.
  • iOS for apps on Apple devices.
  • Android for apps on Android devices.
  • AMP for sites built with Accelerated Mobile Pages.
  • Server for server-side tagging.

Pick Web for a normal marketing site, then click Create and accept the Terms of Service.

One container or several

Google's best practice is one container per web domain. If one user journey spans several domains with the same tags, a single container serving all of them is simpler, because publishing pushes every change live on every domain at once.

Step 2: install the container snippet

Use a CMS integration where possible

In the Workspace tab, click Install Tag Manager or your container ID, which starts with GTM. If your site runs on WordPress, Shopify or Wix, choose your platform and follow the install instructions instead of editing every page.

Install the code manually

For a manual install, copy the code block and paste it as high in the <head> tag of every page as possible. The current snippet is one block that loads gtm.js with your container ID.

Then enter your site address in the dialog and click Test to confirm the container loads.

Older two-part snippets still work

The previous snippet had two parts, one in the head and a noscript iframe after the opening body tag. Google says sites already using it do not need to retag, and the container keeps working as before.

Step 3: add the Google tag

Create the tag

In the Workspace tab, open Tags and click New. Name the tag clearly, choose the destination tag type for the Google product you want, and enter its tag ID.

Choose the right trigger

Google's guide sets the Google tag to fire on the Initialization - All Pages trigger, then you save. This loads the tag early on every page, before ordinary page view triggers.

Add event tags next

Once the base tag works, add tags for the actions that matter, such as form submissions, demo requests or purchases. Our guide to GA4 key events shows how to mark those events as conversions in Analytics.

Name every tag, trigger and variable by tool, action and scope. GrowthCentr suggests a pattern such as "GA4 - event - form submit" so anyone can read the container months later.

Step 4: test in Preview mode

Connect Tag Assistant

Click Preview in the top right to open Google Tag Assistant in a new tab. Enter your site URL and click Connect, and the site opens with your unpublished draft running.

If a page breaks because of the debug parameter, untick Include debug signal in the URL. The debug view only appears in the browser that started Preview, so regular visitors never see it.

Check what fired

Click through your site and watch which tags fired, in what order, and which trigger caused each one. A tag that did not fire usually points to a trigger condition that never matched.

Share a preview with a colleague

In Tag Assistant, open More Actions and select Share to create a preview link. This lets a developer or analyst check the same draft from their own browser.

Step 5: publish a version

Submit and name the version

Click Submit, keep Publish and Create Version selected, and review the Workspace Changes list. Add a version name and description, then click Publish.

Use versions as your safety net

A version is a snapshot of the container at one point in time. If a broken change goes live, you can revert to an earlier version and publish it again.

Work in separate workspaces

Every container has a default workspace, and standard accounts can add up to 2 more workspaces. Tag Manager 360 accounts can create an unlimited number, which suits larger teams.

Step 6: set permissions and consent

Container permission levels

Google lists five container permissions, from lowest to highest:

  • No access: the user cannot see the container.
  • Read: the user can browse tags but not change them.
  • Edit: the user can create workspaces and make edits.
  • Approve: the user can also create versions, but not publish.
  • Publish: the user has full rights, including publishing.

Give Publish rights to as few people as possible.

Account permissions

At account level, a user can be a User or an Administrator. Administrators can create containers and change permissions, so keep that role for the site owner's team.

Consent mode settings

Each web container includes a Consent Initialization - All Pages trigger. It fires before every other trigger, so consent banners and consent defaults load first.

Common mistakes and upkeep

Publishing without testing

The most common error is skipping Preview and publishing a draft with broken triggers. A short test pass on your key pages catches most problems before they reach live data.

Letting the container grow too large

Google shows a Size indicator on the Versions page for large containers, and above 70% you should optimize. Remove unused tags, merge similar tags with lookup variables, and prefer built-in templates over custom HTML.

Forgetting the rest of the stack

A live GTM snippet can also verify site ownership if you hold Publish or Admin rights, a shortcut covered in our Search Console guide. Review the container every quarter and delete tags for tools you no longer pay for.

Conclusion

Setting up Google Tag Manager comes down to one account, one container per site, a snippet high in the head, a Google tag on the Initialization trigger, and a tested, named version. Keep publishing rights tight and the container lean, and every later tracking change becomes a short, reversible edit instead of a code release.

Frequently Asked Questions

Is Google Tag Manager free?

Google Tag Manager is free to use, while Tag Manager 360 is the paid enterprise version that adds features such as unlimited workspaces and zones.

Where does the Google Tag Manager code go?

The current Google Tag Manager snippet goes as high in the head section of every page as possible, or you can use a supported CMS integration instead.

Do I still need the noscript part of the snippet?

Google's current snippet is a single block, and Google says sites using the older two-part version with the noscript iframe do not need to retag.

What is the difference between Tag Manager and gtag.js?

The Google tag sends data to Google products from one code block, while Tag Manager manages many Google and third-party tags, triggers and versions from one interface.

Can visitors see my Preview mode?

Preview mode and the Tag Assistant debug view only appear in the browser that started the session or to people you share a preview link with.

How many workspaces can I use?

A standard Tag Manager container has a default workspace plus up to 2 additional ones, while Tag Manager 360 accounts can create an unlimited number.

Who should own the Tag Manager account?

Google advises that the company whose tags are managed creates the account, then adds agencies or freelancers as users with the permission level they need.

Sources: Tag Manager Help pages linked above, including Create an account and container, Install a web container, Add the Google tag, Verify and publish tags, Preview and debug containers, Users and permissions, Workspaces and consent mode support. Steps checked 30 November 2026. This is not legal or purchasing advice.