Installing Google Tag Manager correctly is the foundation of reliable tracking.
If GTM is installed wrong, everything built on top of it becomes unreliable.
This guide shows you exactly how to install GTM the right way and how to verify it works.
Step 1: Create Your Google Tag Manager Account
- Go to https://tagmanager.google.com
- Click Create Account
- Enter your account name
- Choose your country
- Enter your website domain as container name
- Select Web
- Click Create
You will now see two pieces of code. These are the only scripts you ever need to install manually.
Step 2: Copy the GTM Installation Code
Google gives you two snippets.
Script for the head
<!-- Google Tag Manager -->
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});
var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';
j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;
f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXXX');
</script>
<!-- End Google Tag Manager -->
Noscript for the body
<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->
Replace GTM-XXXXXXX with your container ID.
Step 3: Add GTM to Your Website
Place the script in the <head>
Place the noscript right after <body> opens.
Correct example:
<head>
<!-- GTM Script -->
</head>
<body>
<!-- GTM Noscript -->
Do not put both snippets in the head.
Do not place them at the bottom of the page.
Step 4: Publish Your Container
- Return to GTM
- Click Submit
- Click Publish
GTM will not fire until the container is published.
Step 5: Verify GTM Is Installed Correctly
The easiest method:
- Install the Tag Assistant Chrome extension
- Open your website
- Enable Tag Assistant
- Refresh the page
You should see your GTM container detected.
Alternative check:
Right-click your site → View Page Source → search for GTM-
If you see it in both head and body, installation is correct.
Common GTM Installation Mistakes
• GTM added only in the head
• GTM added through another tag manager
• GTM installed twice
• Container created but never published
• Script placed at bottom of the page
Fixing these early prevents tracking problems later.
Final Thoughts
A correct GTM installation is the base layer of your analytics and advertising setup.
Once this step is done properly, you can safely build tracking, events, and conversions on top of it.
In the next article of this series, we will cover how the GTM interface works and how tags, triggers, and variables connect together.
Related Posts
How Google Tag Manager, GA4, and Google Ads Work Together
7 min read
What Is Google Tag Manager? Beginner Guide for Marketers (2026)
6 min read
How to Maintain Tracking Accuracy as Your Website Evolves
7 min read
Need Help With Your Google Ads?
I help e-commerce brands scale profitably with data-driven PPC strategies.
Get In Touch