About cookies on this site

We use cookies to collect and analyse information on site performance and usage, to provide social media features and to enhance and customise content and advertisements. Learn more

Cookie settings

About cookies on this site

Cookies used on the site are categorized and below you can read about each category and allow or deny some or all of them. Learn more

Necessary

Some cookies are required to provide core functionality. The website won't function properly without these cookies and they are enabled by default and cannot be disabled.

Preferences

Preference cookies enables the web site to remember information to customize how the web site looks or behaves for each user. This may include storing selected currency, region, language or color theme.

Analytical cookies

Analytical cookies help us improve our website by collecting and reporting information on its usage.

Marketing cookies

Marketing cookies are used to track visitors across websites to allow publishers to display relevant and engaging advertisements. By enabling marketing cookies, you grant permission for personalized advertising across various platforms.

  • Courses
    • Paid courses
    • Course bundles
    • Free courses
  • Blog
  • Resources
    • Youtube channel
    • E-books and Guides
    • GTM Recipes
    • View All Resources
    • GTM Community
    • GA4 community
  • Services
  • About
    • About
    • Contact
  • Login
  • Courses
    • Paid courses
    • Course bundles
    • Free courses
  • Blog
  • Resources
    • Youtube channel
    • E-books and Guides
    • GTM Recipes
    • View All Resources
    • GTM Community
    • GA4 community
  • Services
  • About
    • About
    • Contact
  • Login

Where Can I Find the Container Code in Google Tag Manager?

In order to install Google Tag Manager, you have to place its container code on your website. If you’re using some 3rd party plugin to install GTM, all you need to provide is Google Tag Manager ID.

However, in many other cases, you will need to place the entire container code snippet to the source code of your website. This quick guide will show you all the places where that code can be found.

Subscribe and Get the Ebook - Real Book Img - GTM for Beginners

 

Option #1. Code is displayed right after you create a container

When you sign up for a new Google Tag Manager account here, you will be asked to create a new container. Follow all the steps and you’ll see the container code. If you already have at least one GTM container, you can then go to the main list of all your Google Tag Manager accounts and choose one of the two options:

a) You can create a new account (e.g. for your client) and then create a container
b) Or you can click 3 dots next to the already existing account and then choose Create Container

Then follow all the steps and after you hit Create…

Create GTM account

You will see a popup that looks like this (see below). These are the codes you’re looking for.

P.S. All my screenshots here are related to the Web container of Google Tag Manager.

 

Option #2. Click GTM container ID in the top menu bar

Log in to your Google Tag Manager account and open a container. In the top right corner (next to the Submit and Preview buttons) you’ll see some short text that starts with GTM- and then contains some letters/numbers. That’s your Google Tag Manager container ID.

Click that ID (as I’ve displayed above) and you’ll see a popup with two codes. Both of them will contain that very same Google Tag Manager ID. That’s it! You’ve found the Google Tag Manager container code.

Important: the first code is required for GTM to work. It must be placed as high in the website’s source code as possible (recommended in <head>). When someone asks you to add the GTM code, THIS IS THAT CODE. The 2nd code must not be added to the <head>. Add it right after the opening <body> tag instead. Read this blog post for more details.

 

Options #3. Go to the Admin section of your container

One more place where you can find the container code is by going to the Admin section of the container. In the top menu of your Google Tag Manager interface, click Admin.

Then in the 2nd column (container), click Install Google Tag Manager.

Then you will see both GTM codes that need to be added to the site’s source code.

Remember, the first code (surrounded by script tags) is the most important. It MUST be added to the website. The 2nd code (surrounded by noscript tags) is optional. You can learn more about it here.

 

Related resources

Here are some additional guides you will find useful:

  • How to properly install Google Tag Manager?
  • How to check if Google Tag Manager is working?
  • Google Tag Manager Tutorial for Beginners
Subscribe and Get the Ebook - Real Book Img - GTM for Beginners
Hi, I'm Julius Fedorovicius and I'm here to help you learn Google Tag Manager and Google Analytics. Join thousands of other digital marketers and digital analysts in this exciting journey.Read more
Analytics Mania
  • Google Tag Manager Courses
  • Google Tag Manager Recipes
  • Google Tag Manager Resources
  • Google Tag Manager Community
  • Login to courses
Follow Analytics Mania
  • Subscribe to newsletter
Recent Posts
  • A Guide To Google Tag Manager Preview Mode
  • Google Tag Manager vs Google Analytics explained
  • How to Track File Downloads with Google Analytics 4 (including PDF)
Analytics Mania - Google Tag Manager and Google Analytics Blog | Privacy Policy
Manage Cookie Settings