Google Tag Manager Install Code Generator
Google Tag Manager (GTM) is a container that loads your other tags, such as Google Analytics 4, Google Ads conversions or a Meta pixel, so marketers can add and change them without a code release. Installing it takes two snippets: a script in the <head> and a noscript iframe right after the opening <body> tag.
This tool builds both snippets from your Container ID and can check a page to see whether GTM is installed. The checker reports whether the head script, the noscript iframe and a dataLayer are present, whether the container ID matches yours, and any GA4 (G-) or Google Ads (AW-) IDs loaded with gtag.js instead.
How to install and verify GTM
- Enter your Container ID in the form GTM-XXXXXXX and click Generate Code.
- Copy the head snippet into the <head> of every page, as high as possible.
- Copy the body snippet and paste it immediately after the opening <body> tag.
- Publish your site, then check the live URL or paste the page source to confirm both snippets and the right ID are found.
- Use Google Tag Assistant to confirm the tags inside the container actually fire.
When it helps
- New sites: get a correct install snippet without logging in to GTM again.
- Agency handovers: check which container a client site loads and whether it is complete.
- Troubleshooting: find out whether a page uses GTM, gtag.js or both.
GTM vs gtag.js and other tips
- gtag.js loads one Google product directly, such as a single GA4 property. GTM is a manager for many tags with triggers and versions. Pick one approach per tag to avoid double-counting.
- If GA4 is set up inside GTM, remove any hard-coded gtag.js for the same measurement ID, or page views will be recorded twice.
- Changes in GTM only go live when you click Submit and publish a new container version. Use Preview mode to test first.
- Install the same container on every page you want tracked, including landing pages built outside your main CMS.