The Google tag (gtag.js) is a single JavaScript library you paste into your site's code to send data to Google products like GA4 and Google Ads. Google Tag Manager is a container that loads and controls many tags, including the Google tag, from a web interface. Same destination, two different ways to get there.
For a five-page site with one GA4 property, hardcoded gtag.js is fine. For anything with more than one vendor, a consent banner, or more than one person touching tracking, GTM wins, and it isn't close. The one setup I'd never accept is both at once for the same tag ID, because that's how you get duplicate page_view events and a conversion rate that looks half of what it is.
- The Google tag (gtag.js) is code on the page. GTM is a manager that loads code. Inside GTM, the Google tag is just one tag type, called "Google Tag".
- A Google tag has a tag ID (
G-,AW-, orGT-) and one or more destinations. One tag ID can feed GA4 and Google Ads together. - Hardcoded gtag.js makes sense for a tiny site with one destination and no plans. Everything else belongs in GTM.
- Loading the same ID through gtag.js and GTM sends every
page_viewtwice. It's the most common double-tagging bug I find. - Migrating from gtag.js to GTM is a 5-step job. The step people skip is removing the old snippet, including the one a plugin injected.
What the Google tag actually is
The Google tag is gtag.js, a library served from googletagmanager.com/gtag/js?id=G-XXXXXXX. Yes, the GA4 library lives on the Tag Manager domain. That naming confuses everyone, and it's why "I don't use GTM" sometimes means "I use GTM's servers without knowing it".
When you install it, you paste a snippet like this into the <head>:
<script async src="https://www.googletagmanager.com/gtag/js?id=G-ABC123XYZ"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-ABC123XYZ');
</script>
That config line sends a page_view automatically. Every other event needs another gtag('event', ...) call written into your site code by a developer.
Two concepts matter here, and Google reorganized both around 2023, so guides from before that use different words:
- Tag ID. The ID in the snippet.
G-for a GA4 data stream,AW-for Google Ads,GT-for a combined Google tag. - Destinations. Where the data ends up. One Google tag can have several: a GA4 stream and a Google Ads account, for example. You manage this in the Google tag settings (in GA4: Admin, Data streams, your stream, Configure tag settings).
The Google tag settings screen also holds things that used to need code: cross-domain linking, internal traffic rules, unwanted referrals. Those settings apply no matter how you load the tag, gtag.js or GTM.
What GTM is, and where the Google tag fits inside it
GTM is a container. One snippet goes on your site, and from then on you add, change, and remove tags in a web interface, with versioning, preview, and permissions. If you want the longer version, I wrote a plain guide to what Google Tag Manager is.
Inside GTM, the Google tag is a tag type called Google Tag. Since September 2023 it replaced the old "GA4 Configuration" tag. You give it a tag ID, trigger it on Initialization - All Pages, and it does what the hardcoded config call did. Events then go through Google Analytics: GA4 Event tags that reference the same measurement ID.
The parts that make GTM worth it sit around the tag, not in it:
- Variables for reusable values like the measurement ID or user properties. My GTM variables guide covers the built-in, user-defined, and data layer ones.
- Triggers that fire events on clicks, form submits, or custom data layer events without touching site code.
- Google tag: Configuration settings variables, so five GA4 event tags share one set of parameters.
- Consent settings on every tag, Google and non-Google.
Google tag vs GTM side by side
| Google tag (gtag.js) hardcoded | Google Tag Manager | |
|---|---|---|
| Where it lives | Your site's source code or theme | A GTM container, one snippet on the site |
| Who can change it | A developer, via deploy | Anyone with container access, via publish |
| Non-Google vendors | Separate snippets, one by one | Meta, TikTok, LinkedIn, Hotjar as tags in one place |
| Version history | Whatever your git history says | Every published version, one-click rollback |
| Testing | Tag Assistant on live pages | Preview mode before anything goes live |
| Consent gating | gtag('consent', ...) calls in code |
Consent settings per tag, plus Consent Mode |
| Page weight | One library, about as light as it gets | Container plus libraries, grows with tags |
| Best for | 1 site, 1 destination, no changes planned | Everything else |
The page-weight row is the only one where gtag.js wins outright. It's a real advantage on a tiny site. It stops mattering the day you add a Meta pixel.
When hardcoded gtag.js is fine
I'm not a GTM fundamentalist. There are cases where I tell a client to keep it simple.
A portfolio site, a one-page landing for a local business, a documentation site with nothing to convert. One GA4 property, page_view plus enhanced measurement, no ads. Nobody will change the tracking for the next two years. Here, GTM is overhead: another account, another login, another thing to audit.
The same goes for some platforms. If your CMS has a native GA4 field and you need nothing beyond page views, using it is fine. Just know it's gtag.js under the hood.
The trap is that "nobody will change it" is rarely true. The first time someone wants a Google Ads conversion, you're back to the developer queue.
When GTM wins, and why I default to it
Three reasons, in the order they hurt.
Multiple vendors. The moment you run Google Ads plus GA4 plus Meta, hardcoded snippets turn into a pile nobody owns. In GTM, every vendor is a tag with a name, a trigger, and an owner. You can see the whole picture in one list.
Consent gating. With gtag.js, consent means writing gtag('consent', 'default', {...}) before the config call and update after the banner, in code, with the timing right. For non-Google pixels you write separate logic. In GTM, each tag has Consent Settings, and Consent Mode v2 handles the Google side. It's auditable from one screen.
Versioning and rollback. Patryk, a marketing lead at a Poznań B2B software company, had GA4 hardcoded in the theme. A developer refactored the header in May 2026 and dropped the snippet. Nobody noticed for 19 days.
With GTM, that refactor would have dropped the container snippet just the same. The difference is how loud it is. A missing container kills every tag at once, and a weekly monitoring check catches it in days. A single missing config line inside a theme file looks like a slow month.
My default for any business site: GTM, with the Google tag inside it. Hardcoded gtag.js only when I can say in one sentence why GTM isn't needed.
Double-tagging: the bug that halves your conversion rate
This is where the two methods collide. The site has gtag.js in the theme, and GTM has a Google Tag with the same G- ID. Both fire. GA4 receives two page_view events per page load.
GA4 doesn't merge them. Sessions mostly stay right, since both hits share the same client ID and session ID, but views double, engagement metrics skew, and any conversion rate built on page views falls apart. I covered the GA4 side of this in GTM vs Google Analytics. Here's where the duplicate comes from.
Where the second tag hides
- A CMS plugin. Site Kit by Google, a theme's "Analytics ID" field, a Shopify or WooCommerce integration. Each can inject gtag.js on its own.
- A combined tag ID. If your Google Ads
AW-orGT-tag has the GA4 stream added as a destination, loading the Ads tag also sends GA4 data. Add a GA4 Google Tag in GTM, and you've doubled it without ever seeing aG-ID in the source. - A forgotten snippet from the agency before the last one.
Magdalena runs a home decor store in Łódź, about 2,300 sessions a day. Her GA4 showed 4.1 views per session and a purchase conversion rate of 0.6%, while Shopify said 1.3%.
View source: a G- snippet in theme.liquid, left by the store's first developer in 2022. GTM also had a Google Tag with the same ID. I removed the theme snippet on a Tuesday. By the next week, views per session were 2.1 and the GA4 rate was 1.2%.
How to check in 5 minutes
Run these four checks in this order:
- Open your site, view source, search for
gtag/js?id=and note every ID. - Open GTM and list every Google Tag and its tag ID.
- In DevTools, Network tab, filter for
collect?v=2. Reload once and count requests withen=page_viewfor the sametid: more than one means double-tagging. - In GA4, check Admin, Data streams, Configure tag settings, then the linked tag IDs for combined destinations.
Migrating from gtag.js to GTM, step by step
If you're moving from hardcoded to GTM, the order matters. Do it wrong and you get a day of double data or a day of none.
- Inventory first. List every
gtag('event', ...)andgtag('config', ...)call in the code, plus every ID. The GTM audit guide has a checklist that works for this. - Rebuild in GTM, unpublished. A Google Tag with the same tag ID, GA4 Event tags for each custom event, consent settings, and data layer pushes to replace hardcoded event calls.
- Test in Preview. Check every event in Tag Assistant and GA4 DebugView, with the old snippet still live. Expect to see doubles here. That's fine, it's preview.
- Swap in one release. Remove the hardcoded snippet and publish the container in the same deploy window. Minutes apart, not days.
- Verify the next morning. Views per session, event counts, and conversions against the previous week. A sudden 50% drop or 100% jump means something is still loading twice or not at all.
Keep the same measurement ID. Don't create a new GA4 property to "start clean". You'd lose continuity for zero benefit.
Frequently asked questions
Is the Google tag the same as Google Tag Manager? No. The Google tag (gtag.js) is a single library that sends data to Google products. GTM is a container that manages many tags, and the Google tag is one of the tag types you can load inside it.
Can I use gtag.js and GTM on the same site?
Yes, but never with the same tag ID in both. If gtag.js loads G-ABC123 and GTM also has a Google Tag for G-ABC123, every page_view reaches GA4 twice. Pick one method per ID.
Do I still need the Google tag if I use GTM? Yes, in the form of the "Google Tag" tag type inside GTM. You don't need the hardcoded snippet on the page. GTM loads gtag.js for you when the tag fires.
What's the difference between G-, AW-, and GT- tag IDs?
G- is a GA4 data stream, AW- is a Google Ads account, and GT- is a Google tag that can have several destinations. A combined tag can send to GA4 and Google Ads at once, which is also why it can cause hidden double-tagging.
Is gtag.js faster than GTM? Slightly, because it's one library with no container around it. On a site with only GA4 the difference is real but small. Once you add other vendors, GTM is usually lighter than the same set of hardcoded snippets.
How do I know if my site is double-tagged?
In DevTools, filter the Network tab for collect?v=2 and reload. If you see two page_view requests for the same measurement ID on one page load, you have two tags. Then find the second one in the source code, a plugin, or a combined tag destination.
Next steps
Open your homepage source right now and search for gtag/js. If you find it and you also run GTM, check whether the IDs match. That single search catches the problem I fix most often in this whole area.
If you're on hardcoded gtag.js with more than one vendor, plan the move to GTM. It's a day of work, and it's the last time you'll need a developer to add a conversion.
The Free GTM Audit lists every Google tag ID your pages load, from the container and from the source, so double-tagging shows up in one report. If you'd like the migration done or the container watched continuously, that's GTM consulting and monitoring.
Sources and further reading - gtag.js overview (Google for Developers) - Google Tag Manager for web (Google for Developers) - Consent mode implementation (Google for Developers)
Is your site loading gtag.js and GTM at the same time?
The Free GTM Audit shows every Google tag ID your pages load, from the container and from the source code, so you can spot double-tagging in minutes.
Start Free GTM Audit