G Suite is now Google Workspace: everything your business needs to get work done.

Set up and install Tag Manager

This article is for anyone who wants to set up Google Tag Manager for the first time and manage tags on a website.

Install the Google Tag Manager container snippet

Google Tag Manager lets you configure and deploy tags from Google products and third parties.

What is a tag?

Tags are segments of code provided by analytics, marketing, and support vendors to help you integrate their products into your websites or mobile apps. With Google Tag Manager, you no longer need to add these tags directly to your projects. Instead, you configure and publish tags and how they fire from within the Tag Manager user interface.

What is an account?

A Tag Manager account represents the topmost level of organization. Typically, only one account is needed per company. A Tag Manager account contains one or more containers.

What is a container?

A container consists of multiple tags and rules to govern them. There are specific container types that may be used for:

  • Websites
  • AMP pages
  • Android apps
  • iOS apps
  • Running Tag Manager on a server

1. Create a new account and container

When you create a new account, you will walk through the steps to set up a new container.

  1. In Tag Manager, click the Accounts tab > Create account.
  2. Enter an Account Name and select the country for the account.
  3. Enter a descriptive Container name and select the container type.
  4. To create your container, click Create and agree to the Terms of Service.

Result

When your new container first loads, you will see a different dialog depending on the type of container.

  • Web and AMP: You receive the installation code snippet for your website.
  • iOS and Android: You receive a link to the developer documentation.
  • Server: You can choose from provisioning a server automatically or manually.

You can install the container now, or clear the dialog by clicking OK and resume the installation later.

If you want to collect metrics from multiple sources, for example the web and an app, you need to create additional containers for each platform.

Optional: Add more containers to your account

  1. Open Tag Manager.
  2. In the Accounts tab, next to the account name, click More Actions More > Create Container.
  3. Enter a descriptive Container name and select the container type.
  4. To create your container, click Create and agree to the Terms of Service.

2. Install the container

The following instructions are for setting up Web containers to track tags on websites. If you are not experienced with code or do not have access to your website or mobile app code, you may need to ask a developer for help at this step.

If you want to set up a different container type, refer to the developer documentation:

  1. In Tag Manager, click Workspace.
  2. Near the top of the window, find your container ID, formatted as "GTM-XXXXXX".
  3. Click your container ID to launch the Install Tag Manager box.
  4. Copy and paste the code snippets into your website as instructed in the Install Tag Manager box.
    1. Place the <script> code snippet in the <head> of your web page's HTML output, preferably as close to the opening <head> tag as possible, but below any dataLayer declarations.
    2. Place the <noscript> code snippet immediately after the <body> tag in your HTML output.

If you already use tags on your website, migrate them over to your Tag Manager Container, see 3. Add tags. Make sure that tags do not fire twice by removing any hardcoded tags from your code.

To help protect your container from third party snooping, the Tag Manager web page snippet uses HTTPS by default.

If you have reason to deploy your Tag Manager containers in a way that supports non-secure pages, you may do so by adjusting the source URL protocol in your container snippet to // instead of https://. Learn more about using protocol-relative URLs.

3. Add tags

Now that you installed the container on your website, you're ready to add new tags.

  1. In your Workspace, click Tags.
  2. To add a tag, click New.
  3. Name your tag and configure it:
    • Tag Configuration: Choose the type of tag you want to manage. Google Tag Manager supports tags for Google products and third party tags. If you need more help with setting up a tag from a Google product, refer to Your guide to Google Tag Manager.
      If you no tag type matches, you can create a custom HTML or image tag.
    • Triggering: Triggers govern if a page tag is fired or blocked. Learn more about triggers
  4. Optional: Add a note to your configuration for later reference. To add a note, click the more actions More menu and select Show Notes
  5. Click Save and create more tags as needed.

4. Verify that your tags work

After you have added tags, make sure that they behave as intended. To verify your tag setup:

  1. Click the Preview button. Google Tag Assistant launches in a new tab.
  2. Enter the website URL on which you installed the Tag Manager container. If there are any errors, start debugging with the Tag Assistant.
  3. To edit a tag, click on a tag name to change its settings. For example, when a tag gets fired after a page loaded, but you want it to fire if someone clicks a button, update the trigger.
  4. Save your changed tag and verify that the problem was solved by launching the Preview mode again.

5. Publish tags

When your tags work as intended, publish them.

To publish your current workspace:

  1. Click Submit at the top right hand side of the screen. The Submit Changes screen will appear, with options to publish the container and save a version of your container.
  2. Select Publish and Create Version if it is not already selected.
  3. Review the Workspace Changes section to see if your configuration appears as you expect.
  4. Enter a Version Name and Version Description.
  5. Click Publish.
Was this helpful?
How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
Search Help Center
false
false
true
102259
false
false