Google Tag Manager (GTM) installs in three moves: create an account and container, paste one snippet high in the page head and one right after the opening body tag, then verify in Preview mode before you publish. Google itself recommends GTM for deploying tags, and the Google tag it manages already connects to Analytics, Google Ads, Campaign Manager, Display & Video 360, and Search Ads 360, so you rarely need a second hardcoded snippet.
The usual risk is installing GTM on top of tags that are already firing. Each step below says what it protects, such as conversion counts.
The path in 7 steps
The steps of this page, in order.
-
01 Audit what fires now List every hardcoded GA4, Google Ads, or gtag.js snippet before you touch the site.
-
02 Create the container Set up the GTM account and container, and copy your container ID.
-
03 Choose your install method Manual code, a CMS plugin, or a platform workaround, pick based on your site and risk.
-
04 Place the snippets Head snippet as high as possible, body snippet immediately after the opening body tag.
-
05 Connect GA4 and Ads Move your Google tag into GTM; link Google Ads and GA4 in their own admin screens.
-
06 Verify before publishing Use Preview mode and Tag Assistant to confirm one fire per event, then publish.
-
07 Know your rollback Agree in advance who restores the last good container version, or the site files, if something breaks.
01 / 11
What exactly does installing GTM actually change?
GTM puts one container snippet on your site and lets you add or edit tags from a web interface instead of editing HTML.
Your GA4 and Google Ads conversions keep reporting the same way, what changes is who does the work. A new tag becomes an edit in the container, the box inside your GTM account that holds every tag for one website, instead of a ticket to a developer.
One person can own it, or a 20-person web team can share it; the install itself is the same. What varies is your site's template system, whether a plugin already manages scripts, and whether old hardcoded tags are still firing.
Plain HTML site
You paste GTM's snippet, the short code block it gives you, into your site's HTML templates. Anyone who can edit those files can do it in minutes.
- Who it suits
- Static sites, custom builds, or a developer you can reach quickly
- Typical effort
- One editing session, two snippet placements
Key pointKeep a copy of the original template before you paste anything.
WordPress site
A plugin or your theme's header settings place the snippet for you, so no template file gets touched. Check whether another plugin already injects scripts before adding one.
- Who it suits
- Teams editing content in WordPress without server access
- Typical effort
- Under an hour, mostly verification
Key pointConfirm the container ID appears once in the page source, not twice.
Hosted platform
Squarespace, Wix, Shopify and similar tools expose a code or custom-script field. You paste the snippet there rather than into HTML you host yourself.
- Who it suits
- Stores and sites on a closed platform
- Typical effort
- Minutes, but capped by what the platform allows
Key pointNote any script limits the platform documents before you plan a large container.
02 / 11
What should I check before I install anything?
Audit what fires now, or you will double-count every conversion after you publish.
Open your homepage, right-click, and choose View Page Source. Use Ctrl+F (Cmd+F on Mac) to search for gtag.js, googletagmanager.com/gtag/js, and IDs starting with AW- or G-. The Google tag is the single Google measurement snippet that GTM manages on your behalf for Analytics and Ads.
Write down each Google Ads conversion ID and GA4 measurement ID you find, plus where it lives: a theme file, a plugin, or a hardcoded page. Name one person as the GTM owner, so two people don't publish conflicting changes.
Search for gtag.js
In View Page Source, find every instance of gtag.js. Each one is a separate tracking snippet that could double-fire.
Check for AW- and G- IDs
Use Ctrl+F to find IDs starting with AW- (Google Ads) or G- (GA4). Log each ID and the page or template it appears on.
Locate where each ID lives
Note if the snippet is in a theme file, a CMS plugin, or a hardcoded page. This tells you what to remove or leave alone.
Assign one GTM owner
Choose one named person to publish changes. Shared publishing rights lead to conflicting edits and broken tags.
Going further
Show me the audit
Method
How to read a page source like a non-developer
You can find tracking IDs on any page with View Source and a simple find, no coding required.
Right-click anywhere on the page and select View Page Source from the menu. This opens a new tab showing the raw HTML the server sent. Don't be overwhelmed by the code, you only need the find function.
Press Ctrl+F (Cmd+F on Mac) and type gtag.js. The browser highlights every match, so you can jump through them one by one. Repeat the search for googletagmanager.com/gtag/js and for IDs that begin with AW- or G-. Write down each ID and the surrounding context, like a script tag or a function name, to identify which tool it belongs to.
If you prefer not to touch the browser, you can also look at your CMS's header settings. Many platforms have a dedicated field for header scripts, where these snippets often live. The goal is a complete list before you install GTM.
- gtag.js found?Search for gtag.js in View Source. Each match is a snippet that may need to be removed or left alone.
- AW- and G- IDs logged?Find every ID starting with AW- (Google Ads) or G- (GA4). Record them and the pages they appear on.
- Location noted?For each ID, note if it's in a theme file, a plugin, or a hardcoded page. That tells you how to manage it.
- One owner named?Pick one person to own GTM publishing. Multiple owners cause conflicting changes.
03 / 11
Where do the GTM snippets go, and what breaks if they don't?
The first snippet goes as high as possible in the page head; the second goes right after the opening body tag.
Think of a snippet as the short block of code GTM gives you to paste into your site's HTML. The first snippet, a script, belongs as high as possible inside the page head; if it sits below other scripts, GTM loads late and can miss early events like page views. The second snippet, a noscript iframe, goes right after the opening body tag.
That second snippet only runs when JavaScript is turned off in the browser, which is rare; Google still asks for it. Both snippets must appear on every page you want to track, including thank-you and landing pages.
-
Place the first snippet high in the page head
Paste it as close to the opening head tag as possible, before other scripts. If placed lower, GTM loads late and may miss page views on fast-loading sites.
-
Place the second snippet right after the opening body tag
Paste it right after the opening body tag. It is the noscript fallback Google provides for visitors with JavaScript turned off.
-
Repeat on every page you want to measure
Add both snippets to every page, including thank-you pages and landing pages. Missing pages lose conversion and engagement data.
04 / 11
Manual code, a CMS plugin, or a platform workaround?
Manual code gives control, plugins give speed, and some hosted platforms only accept a workaround; the right one depends on how much risk your site can take.
Manual code puts the container snippet directly in your site's template, so you control the exact placement and there's no third party in the chain. The catch: a theme update can overwrite the file and erase your snippet, so keep a copy of the change outside the theme. A CMS plugin is faster, but it adds a maintainer outside your team and can clash with an SEO or caching plugin that already injects scripts. Hosted builders often need an app, a custom code field, or a worker in front of the site, each adds a failure point worth writing down.
The matrix below shows what each method risks. Whatever you choose, note in one line where the container snippet lives, so the next person can find it after an update.
Manual code in the template
- Exact control over placement and load order
- No outside owner between you and the site
- A theme or template update can erase it
- Needs developer time for the first install
Best when you own one template file and have a developer on call.
CMS plugin
- Fast setup, no code editing
- Easy to update or remove from the admin
- Adds a maintainer outside your team
- Can conflict with SEO or caching plugins that already inject scripts
Good for small teams that want speed and accept a third-party dependency.
Hosted-platform workaround (app, custom code field, or worker)
- Only option on closed platforms
- Keeps the snippet off your own server in some setups
- Each layer adds a failure point
- Behavior depends on the platform's limits
Use when the platform gives you no direct template access.
05 / 11
How do I connect GA4 and Google Ads in one container?
Move your existing Google tag into GTM, then link Google Ads to the container so both platforms read the same source.
A container is the box inside your GTM account that holds every tag for one website. Create a single Google tag in it, the one measurement snippet GTM manages for you, and point both GA4 and Google Ads at that tag. The Google tag can send data to Analytics, Ads, Campaign Manager, Display & Video 360 and Search Ads 360, but you add each destination yourself in the tag settings.
In the same change window, delete the matching hardcoded snippet. Leave it in place and the same conversion fires twice, inflating your numbers. And keep one container per site: separate containers per team breed duplicate tags nobody audits.
-
Create the Google tag
In your container, create the Google tag and copy its ID. This becomes the single measurement point for the site.
-
Connect GA4
In the Google tag settings, confirm the GA4 configuration and measurement ID it should send data to.
-
Link Google Ads
Add the Google Ads conversion ID as a destination of the same Google tag, then link Google Ads and GA4 in their own admin screens (Product links), not in GTM.
-
Remove the hardcoded snippet
Find the old Google tag or gtag.js snippet in your site code or CMS head settings and delete it in the same window.
-
Verify one source
Check that GA4 and Google Ads now receive data from the container tag only, with no duplicated events.
06 / 11
How do I prove GTM works before publishing?
Preview mode shows each tag firing in real time; Tag Assistant confirms the Google tag is detected on the page.
Flip Preview mode on (the GTM state where tags are tested in your own browser before real visitors see them), open a key page, and watch the firing summary. Each tag should fire exactly once: twice signals a duplicate tag, zero signals a placement or trigger problem. Turn Preview off to compare against live behavior.
Then open Tag Assistant or your browser developer tools and confirm your Google tag ID appears under the Google tags found header. Test a second page behind a login and one on mobile, not just the homepage.
Every key tag fires exactly once
One fire is the target. Two means a duplicate tag or overlapping trigger; zero means a placement or trigger problem to fix before publishing.
Google tag ID detected on the page
Tag Assistant or developer tools should list your tag ID under the Google tags found header, confirming the container loaded.
A logged-in page passes the same test
Login walls load different templates. Run the same fire-once check there so you don't publish a container that misses them.
Mobile matches desktop
Mobile layouts can load the snippet at a different point. Confirm the same tags fire once on a phone before you publish.
07 / 11
What blocks GTM silently, consent or security rules?
Consent Mode and Content Security Policy can stop GTM without any visible error in your analytics.
Consent Mode, the setting that tells Google tags whether a visitor agreed to tracking, can be misconfigured so tags fire without the signals they need and data quietly drops. Google's consent mode guide lists the consent signals tags read.
A Content Security Policy (CSP), a browser rule listing which domains may load scripts, will block GTM if googletagmanager.com is not allowed. MDN's CSP reference (developer.mozilla.org/en-US/docs/Web/HTTP/CSP, consulted November 5, 2026) documents the violation format the console shows. Neither point is legal advice; ask counsel what your business must disclose, and keep the technical fix separate.
Consent Mode
A setting that tells Google tags whether a visitor has agreed to tracking. If it is missing or the wrong version, tags may fire without consent signals and GA4 or Ads data looks incomplete.
- Console signature
- No hard error; look for tags firing with denied or absent consent signals in Tag Assistant.
- First fix
- Check your Consent Mode version against Google's official documentation before changing any tag.
Key pointOpen Google's Consent Mode guide, note the version you use, and correct the default consent state before debugging individual tags.
Content Security Policy (CSP)
A browser security rule that can block GTM's script if the domain is not allowed. The page may look fine while GTM never loads.
- Console signature
- Refused to load the script 'https://www.googletagmanager.com/gtm.js?id=GTM-XXXX' because it violates the following Content Security Policy directive: "script-src ...".
- First fix
- Add https://www.googletagmanager.com to the script-src directive, then reload and recheck the console.
Key pointCopy the exact violation line and send it to whoever manages your site headers; MDN's CSP reference explains the directive names.
08 / 11
What if publishing breaks the site?
You need a two-minute path back to the previous working state, written down before you publish.
Google Tag Manager keeps a full version history of your container, so you can publish an earlier version to undo a bad container change. That does not touch your site files: a snippet you added or removed in the theme stays as it is. The site itself only breaks if you edited theme code or a plugin by hand.
Write your rollback plan before you publish, and keep the first publish outside peak traffic hours so you can watch an hour of data with a clear head.
-
Confirm your safety net
Before the first publish, back up your site or theme files and name the one person who can restore them. If you used a CMS plugin, note which plugin holds the snippets.
-
Restore the last good version
Open Versions in your GTM workspace, pick the last version that worked, and restore it. Then publish that version so the container matches what you had.
-
Fall back to site restore
If the site itself is broken, not just tracking, restore your theme or plugin backup. That is the path that brings the pages back, because GTM never edits your files.
-
Watch the first hour
Publish when traffic is low, then check your GA4 realtime report and your Google Ads conversion actions to confirm both still receive data before you step away.
09 / 11
Is GTM still the right choice, or should I hardcode?
Google recommends GTM for deploying tags, and for a small team it removes the biggest cause of broken tracking: unreviewed hand edits.
Choose GTM when your site carries more than one tag and more than one person asks for changes. It gives each request a version history and a preview mode, which is exactly what keeps Google Ads and GA4 intact.
Hardcoding still works for a single static tag on a site nobody edits, just accept that every future change becomes a code deploy. Call a contractor when your site sits inside a platform with no clean code access, or when IT controls a CSP (Content Security Policy, the browser rule list that decides which scripts may run) and you cannot reach them.
Stay with GTM
This fits a site with several tags and several people requesting edits. You get version history and preview before anything goes live.
- Choose it when
- Two or more tags, two or more requesters
Key pointKeep every change in a named version.
Stay hardcoded
This fits a single static tag on a site no one touches. There is no container to learn, but each change is a code release.
- Choose it when
- One tag, one owner, no edit requests
Key pointWrite the code down where the next owner will find it.
Escalate to a specialist
This fits a site locked inside a platform with no clean code access, or a CSP controlled by IT outside your reach. You stay the owner; they clear the technical block.
- Choose it when
- No code access or IT-managed CSP
Key pointAsk for the change in writing so you can repeat it.
10 / 11
Frequently asked questions
11 / 11
Sources, data and disclaimer
Sources
- Tag Manager Help: Set up and install Tag Manager
- Google for Developers: Tag Manager for web
- Google for Developers: Consent mode
- MDN: Content Security Policy
Disclaimer
Checked in November 2026. GTM screens and install steps change from time to time; confirm in the official help before you edit a live site.










