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

  1. Go to https://tagmanager.google.com
  2. Click Create Account
  3. Enter your account name
  4. Choose your country
  5. Enter your website domain as container name
  6. Select Web
  7. 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

  1. Return to GTM
  2. Click Submit
  3. Click Publish

GTM will not fire until the container is published.


Step 5: Verify GTM Is Installed Correctly

The easiest method:

  1. Install the Tag Assistant Chrome extension
  2. Open your website
  3. Enable Tag Assistant
  4. 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

Google Tag ManagerGA4Google AdsConversion TrackingGTM Intro Series

What Is Google Tag Manager? Beginner Guide for Marketers (2026)

6 min read

GTMGoogle Tag ManagerTrackingConversion TrackingGTM Intro Series

How to Maintain Tracking Accuracy as Your Website Evolves

7 min read

Conversion TrackingGoogle Tag ManagerAnalytics StrategyGTM Intro Series
Adnan Agic

Adnan Agic

Google Ads Strategist & Technical Marketing Expert with 5+ years experience managing $10M+ in ad spend across 100+ accounts.

Need Help With Your Google Ads?

I help e-commerce brands scale profitably with data-driven PPC strategies.

Get In Touch
Back to Blog