How to Install Google Tag Manager on Your Website
Learn how to install Google Tag Manager properly on your website with this step-by-step guide by paid media specialist Bernardo Viana.
Quick summary
- Google Tag Manager allows you to manage multiple tracking tags without altering your website code repeatedly.
- Always create one overarching account for your business and a separate web container for your specific website URL.
- Use the built-in preview mode to thoroughly test your container installation before publishing changes.
When managing paid ads, having the right data is everything. If you want to track what users do on your site without constantly editing your website’s source code, you need a centralized system. In practice, what I see is that many business owners struggle to deploy marketing and analytics tags properly, leading to broken data and wasted ad spend. This is where Google Tag Manager comes in. Google Tag Manager is a tool that lets you configure and deploy tags (snippets of code or tracking pixels that record what visitors do on your site) from Google products and third parties without modifying your core website code every time. In this guide, I will show you how to install Google Tag Manager from scratch.
Before you start
Before you dive into the setup, you need a few prerequisites in place. First, you need an active Google Account to sign in. Second, you need administrative access to your company’s website or content management system so you can place code snippets on your pages. Finally, you should have your website URL ready. Tag Manager is organized hierarchically: you create one account for your company, and then you create separate containers (the specific code containers that hold your tracking tags) for each of your websites or applications. For most businesses, you will only need one account and one web container to get started.
Step by step
To set up your account and container correctly, follow these numbered steps based on the official setup process:
- Sign in to your Google Account. If you do not have one, create a new Google Account.
- Navigate to Tag Manager, click the Accounts tab at the top left, and then select Create Account at the top right.
- In the Account Setup section, enter an account name representing your company and select the country location for the account.
- Optional: Select the option to share data anonymously with Google and others to enable benchmarking if you want to contribute anonymous aggregate trend data.
- In the Container Setup section, enter a container name. For a website, use your top-most URL, such as www.example.com. You do not need a separate container for every individual page.
- Select your container type. For standard websites, choose Web (most common). Other options include iOS, Android, AMP, and Server depending on your digital property.
- Click Create and review and agree to the Terms of Service.
- Once your container is created, you will be prompted to install the necessary code snippets into your website’s HTML.
How to test that it works
After adding the code snippets to your website, you must verify that the setup is functioning correctly. In practice, I always recommend using the built-in preview mode inside Tag Manager before publishing any changes live. Click the Preview button in your container dashboard, enter your website URL, and check if the Tag Manager debug window connects successfully to your site. This ensures your container is firing properly on your pages.
Common problems
Even with a straightforward setup, advertisers often run into a few common issues. Here is how to address them:
Code snippet placed in the wrong section
If your tags fail to fire, check your website’s HTML source code. The primary Tag Manager snippet must be placed as high in the of your page as possible, and the secondary noscript snippet should be placed immediately after the opening tag.
Multiple containers installed
If you see duplicate tracking data or conflicting events, you might have accidentally installed more than one container or mixed up your container IDs. Double-check your unique container ID (which starts with GTM-) against the code installed on your website.
Permission errors
If you cannot see the Create Account or Create Container buttons, verify that you are signed into the correct Google Account with the proper administrative permissions.
Next steps
- 1.Log into your Google Account and navigate to Tag Manager to create your company account.
- 2.Set up a Web container using your primary website URL.
- 3.Copy the generated code snippets and place them into your website's header and body sections.
Based on reporting by support.google.com : “https://support.google.com/tagmanager/answer/6103696”. Read the original for the full story.
This article was written with AI assistance from the source reporting, following Bernardo Viana's editorial guidelines, and checked automatically against the source. Educational content. Ad results vary from business to business. How we work.