Google Measurement Stack
Checked: 2026-10-29
Google has one library that knows how to talk to Google’s products (gtag.js, now “the Google tag”) and one container that can load anything, including that library (Google Tag Manager). Different layers, not rival products — and both read the same
window.dataLayerqueue, which is why a site can accidentally run both and count everything twice.
No Google product is called “the Google measurement stack” — it’s a label for the collection-to-report path across several products. Google’s own umbrella brands cut it differently: Google Marketing Platform (the enterprise 360 products, plus Analytics and Tag Manager), Google Ads, and Google Cloud (BigQuery, Data Studio).
§0 The one idea
The Google tag is a messenger. Google Tag Manager (GTM) is a loader. Most of the confusion comes from treating them as two ways of doing the same job.
GOOGLE TAG (gtag.js)
a JavaScript library
knows Google's destinations: GA4, Google Ads, Floodlight
you call it: gtag('event', 'purchase', {...})
can't load anything that isn't Google
GOOGLE TAG MANAGER (gtm.js)
a container — a script whose contents are
edited in a web UI and published without a deploy
loads anything: the Google tag, Meta's pixel,
a chat widget, your own Custom HTML
you don't call it; you push facts at it and
it decides what to fire
So the real choice is never “GTM or the Google tag”. It’s who loads the Google tag — your page’s <head>, or a GTM container — and who decides when events are sent — your code, or rules in the GTM interface.
At a glance
| Google tag (gtag.js) | Google Tag Manager | |
|---|---|---|
| What it is | Library for Google destinations | Container that loads any script |
| ID on the page | G-, AW-, GT- | GTM- |
| You talk to it with | gtag('event', …) | dataLayer.push({ event: … }) |
| Changed by | Code release (plus settings in GA4/Ads admin) | Publishing in the GTM web UI |
| Loads third-party tags | No | Yes |
| Can load the other | No | Yes — its “Google tag” tag is gtag.js |
vs Adobe: same split as Adobe’s Web SDK (the messenger) and Tags (the container) — Adobe Experience Cloud. Google’s version is more confusing only because both pieces are served from the same domain and both say “tag” in the name.
The acronym and ID decoder
The single most useful thing on this page. The prefix on an ID tells you which product owns it.
| Prefix | What it is | Where it appears |
|---|---|---|
G- | GA4 measurement ID — one GA4 web data stream | gtag/js?id=G-…, gtag('config', 'G-…'), GTM’s GA4 Event tag |
GTM- | GTM container ID — one web container | the GTM snippet’s gtm.js?id=GTM-… |
AW- | Google Ads conversion ID — one Ads account | gtag('config', 'AW-…'), send_to: 'AW-…/label' |
DC- | Floodlight advertiser — Campaign Manager 360’s conversion tracking | gtag('config', 'DC-…') |
GT- | Google tag ID — a Google tag in its own right, which can route to several destinations | the gtag/js?id= URL when the tag was created from Ads or combined |
UA- | Universal Analytics property. Dead — stopped collecting in 2023–24 | old snippets, nowhere useful |
| API (application programming interface) secret | Not a prefix — a key generated per GA4 data stream, sent with the G- ID by the Measurement Protocol | server code only, never the browser |
Tag ID vs destination. A tag ID is what you put on the page to load a given Google tag. A destination is a product account the tag sends data to. One Google tag can carry several destinations, so the ID in the script URL (G-ABC) may route to a GA4 stream and an Ads account configured in the Google tag’s settings, not in your code. Removing a destination doesn’t change the tag ID.
[CHECK: a third-party report from April 2026 claims Google is retiring the AW- format in favour of GT-. No Google documentation found confirming it — verify before assuming new Ads accounts get AW- IDs.]
Other acronyms used below:
GTM Google Tag Manager
GA4 Google Analytics 4
UA Universal Analytics (GA's previous generation)
sGTM server-side GTM — a server container
CMP Consent Management Platform (the cookie banner vendor)
EEA European Economic Area
SDK Software Development Kit
CM360 Campaign Manager 360 (ad serving, Floodlight)
DV360 Display & Video 360 (programmatic buying)
SA360 Search Ads 360 (search bid management)
The layers
Top to bottom, the path an event takes. Every box is optional except the first and one destination.
PAGE / APP CODE
knows what happened: "order 4471, £84.00"
│
▼
window.dataLayer ── the shared queue
plain-object pushes { event: 'purchase', ecommerce: {...} }
gtag() command pushes Arguments['event', 'purchase', {...}]
│
├──────────────────────────┐
▼ ▼
GOOGLE TAG (gtag.js) GTM WEB CONTAINER (gtm.js)
loaded in <head> triggers decide when
reads gtag commands tags read variables
│
├─ Google tag (config)
├─ GA4 Event tags
├─ Google Ads conversion tags
└─ third-party: Meta, TikTok,
Hotjar, Custom HTML…
│ │
└────────────┬─────────────┘
▼
CONSENT MODE ── checked by every Google tag before sending
granted → full hit with cookies
denied → cookieless ping, or nothing
│
▼ (optional)
FIRST-PARTY HOP
Google tag gateway: script + hits served via your domain
server-side GTM: one request in, many out
│
▼
DESTINATIONS
GA4 property · Google Ads · Floodlight (CM360)
│
▼
ANALYSIS
GA4 reports & explorations
BigQuery export → Data Studio dashboards, SQL
What to notice: the Google tag appears twice — once loaded directly, once as a tag inside GTM. It’s the same library either way. GTM’s “Google tag” tag is gtag.js, injected by the container instead of hardcoded.
Consent Mode sits inside the tags, not in front of them. It’s not a layer that blocks scripts; it’s a state the Google tags read before deciding what to send — see Consent below.
The crux: the snippet, and the same event three ways
What the gtag snippet actually is
Google’s own install code, verbatim apart from the ID:
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-ABC123"></script>
<script>
window.dataLayer = window.dataLayer || []; // create the queue, or reuse GTM's
function gtag(){dataLayer.push(arguments);} // ← the whole of gtag()
gtag('js', new Date()); // timestamp the load
gtag('config', 'G-ABC123'); // configure a destination → sends page_view
</script>Read line 4 twice. gtag() is not the library. It’s a two-word shim that drops its arguments onto the data layer queue. The library (gtag/js, loaded async on line 1) arrives later, takes over dataLayer.push, and replays the queue — the mechanism in The Data Layer. That’s why you can call gtag() before the script has loaded and lose nothing.
Note the domain: gtag.js is served from googletagmanager.com. A Google tag is a GTM container that Google builds for you. Google’s own Tag Manager release notes (9 July 2026) say so outright: a container loaded with a G- or AW- ID is restricted to Google-provided tags and variables, one loaded with GTM- isn’t — the ID decides what the container may do, whichever snippet loaded it. So “gtag vs GTM” is really “a container Google configures vs a container you configure” — Google Tag Manager.
Why arguments, and what GTM does with it
Two shapes go onto the same array:
// gtag style — pushes the function's Arguments object (array-like, not an Array)
gtag('event', 'purchase', { value: 84 });
// dataLayer gets: Arguments { 0: 'event', 1: 'purchase', 2: { value: 84 } }
// GTM style — pushes a plain object
dataLayer.push({ event: 'purchase', ecommerce: { value: 84 } });
// dataLayer gets: { event: 'purchase', ecommerce: { value: 84 } }- A plain object is merged into GTM’s internal data model; an
eventkey in it becomes a GTM event that triggers can match. This is GTM’s native language - An
Argumentsobject is a command —config,event,set,consent. TheArgumentstype is how the library tells a command from a message - GTM understands command pushes too. Google’s own Consent Mode docs set defaults with
gtag('consent', 'default', {...})in page code above the GTM snippet, and GTM’s tags honour them. Order matters: that line must run before the container loads - Rewriting
gtagwith rest parameters breaks it.function gtag(...args){ dataLayer.push(args) }pushes a realArray, which isn’t recognised as a command — a recurring bug in framework wrappers. Keep theargumentsform
[CHECK: whether a page-level gtag('event', 'x') call, on a GTM-only site, (a) is sent by a Google tag the container loaded, and (b) creates a GTM event that a Custom Event trigger can match. Behaviour reported both ways — test in preview mode before relying on it. Partial answer: since 8 October 2026, gtag('config') commands surface in the data layer as visible gtag.config events, so GTM does see gtag-style pushes, and a wildcard Custom Event trigger can match them.]
One purchase, three ways
The vendor-neutral version of this choice is Hardcoded vs Tag-Managed Tracking. Here’s the Google-specific shape.
(a) Hardcoded gtag — the developer sends the event to Google directly.
gtag('event', 'purchase', {
transaction_id: 'T4471',
value: 84.00,
currency: 'GBP',
items: [{ item_id: 'SKU_12', item_name: 'Linen shirt', price: 42.00, quantity: 2 }]
});(b) Data layer push + GTM — the developer states the fact; GTM decides who hears it.
dataLayer.push({ ecommerce: null }); // clear the previous ecommerce object — GTM merges, it doesn't replace
dataLayer.push({
event: 'purchase',
ecommerce: {
transaction_id: 'T4471',
value: 84.00,
currency: 'GBP',
items: [{ item_id: 'SKU_12', item_name: 'Linen shirt', price: 42.00, quantity: 2 }]
}
});IN GTM
Trigger Custom Event · event name = purchase
Tag GA4 Event · event name purchase · "send ecommerce data" from data layer
Tag Google Ads conversion · value = DLV ecommerce.value
Tag Meta pixel Purchase (template) · same trigger
(c) DOM scraping in GTM — nobody touched the code.
IN GTM
Trigger Page View · Page Path contains /order-confirmation
Variable Custom JavaScript → document.querySelector('.order-total').innerText
→ strip "£", parseFloat
Tag GA4 Event · purchase · value = that variable
| (a) Hardcoded gtag | (b) Data layer + GTM | (c) DOM scraping | |
|---|---|---|---|
| Who changes it | Developer, via release | Developer states fact once; marketer wires tags | Marketer alone |
| Adding Meta/TikTok | Another hardcoded integration | Another tag on the same trigger | Another tag, same fragility |
| Data quality | Exact | Exact | Breaks silently on redesign, locale, refresh |
| Duplicates on refresh | Developer’s problem | Developer’s problem | Fires on every reload of the confirmation page |
| Vendor lock | Google’s schema in your code | Google’s schema in the data layer (it’s the convention everyone copies) | None, and no contract |
| Fits | One destination, a dev team that owns tracking | Most commercial sites | Emergencies, while (b) is built |
Why people do (a): it’s what Google’s docs show first, it’s one dependency, and on a site with only GA4 there’s nothing for a container to add. Why people do (b): the day a second vendor arrives, (a) means a release per vendor and (b) means one more tag. Why people do (c): no developer available. It works until the next front-end change, and the failure is always missing revenue — Tag Managers.
Note (b) uses Google’s GA4 ecommerce shape in the data layer. That’s fine and conventional — Ecommerce Event Schema — but it means the “vendor-neutral” layer is in practice Google-shaped.
When both are installed
The common mess: a hardcoded gtag snippet for GA4 (from a plugin, a theme, or the original build) and a GTM container someone added later with its own Google tag for the same G- ID.
<head>
gtag/js?id=G-ABC123 → config → page_view ①
gtm.js?id=GTM-XYZ
└─ Google tag G-ABC123 → page_view ② ← same stream, twice
- Every page view counts twice; sessions look normal but views per session double, and any event sent both ways doubles too — Double Counting
- Engagement metrics drift in ways that look like a real behaviour change
- Diagnose in Tag Assistant or GTM preview: two requests to
/g/collectwith the sametidper page load - Google’s own guidance: if Tag Manager is in use, there’s no need to deploy gtag.js separately. Pick one owner for each destination ID
Shopify and WordPress plugins are the usual source of the hidden hardcoded copy. Check the theme and installed apps before blaming GTM.
What renamed into what
Settled history. Old names in a brief usually date when the implementation was last touched.
| Year | Change |
|---|---|
| 2005 | Google acquires Urchin → Google Analytics, tracked with urchin.js |
| 2007 | ga.js replaces urchin.js; async snippet version 2009 |
| 2012 | Google Tag Manager launches [CHECK: month — October 2012 widely cited] |
| 2012–13 | analytics.js — Universal Analytics, UA- IDs, ga('send', …) (sources split on 2012 beta vs 2013 release) |
| 2017 | gtag.js — the “Global Site Tag”, one script for Analytics and Ads |
| 2019 | App + Web property in beta — the event-based model |
| Oct 2020 | App + Web renamed Google Analytics 4; G- IDs |
| Aug 2020 | Server-side GTM in public beta (unveiled January 2020) |
| 2022 | Global Site Tag renamed “Google tag” — announced May, rolled out from August. Existing installs converted, no code change |
| Oct 2022 | Data Studio → Looker Studio |
| Jul 2023 | Standard UA stops processing |
| Sep 2023 | Google Optimize and Optimize 360 shut down (30 Sep). Google’s A/B testing tool is gone; there’s no Google replacement |
| Sep 2023 | In GTM, the GA4 Configuration tag becomes the “Google tag” tag, auto-migrated; GA4 Event tags now take a measurement ID directly |
| Nov 2023 | Consent Mode v2 — adds ad_user_data and ad_personalization |
| Mar 2024 | Consent Mode v2 effectively required for EEA and UK traffic to keep Ads audience and measurement features [CHECK: exact day — sources say 1 or 6 March] |
| Jul 2024 | UA 360 stops; all UA services and APIs off, UA data deleted |
| May 2025 | Google tag gateway for advertisers launches — first-party serving of the Google tag, Cloudflare as launch partner |
| Apr 2026 | Looker Studio → Data Studio. The 2022 rename reversed; free Data Studio and paid Data Studio Pro |
| Jul 2026 | Container ID governs capability — G-/AW- loads restricted to Google tags and variables; GTM- unrestricted |
| Oct 2026 | gtag('config') surfaces in the data layer as gtag.config events; GTM containers can send to Google destinations directly instead of loading extra gtag.js, via destination tags — Google Tag Manager |
The two renames that cause most confusion: “Global Site Tag” is the Google tag — same gtag/js file, same gtag() calls. And “Looker Studio” is now Data Studio again, so documentation from 2022–26 uses the middle name.
The products, by job
Collection
- Google tag (gtag.js) — the library. Configured partly in code, partly in the Google tag settings screen inside GA4 or Ads (destinations, domains, which automatic events to detect)
- GTM web container — the loader and rule engine. One paragraph here; workspaces, versions, trigger types, templates and preview mode are in Google Tag Manager
- Server-side GTM (sGTM) — a second container that runs on a server you pay for, usually a subdomain of your site. The browser sends one stream to it; it forwards to GA4, Ads, Meta’s Conversions API and the rest. Earns its keep on consent control, cookie lifetime and stripping data before vendors see it — Server-Side Tag Management, Client-Side vs Server-Side Tracking, Server-Side Conversion APIs
- Google tag gateway for advertisers — serves the Google tag script and its hits through your own domain via a CDN (Content Delivery Network), load balancer or web server. Not a container: no rules, no third-party tags. Google recommends pairing it with sGTM rather than choosing between them — Ad Blockers and Tracking Loss, Cloudflare
- Measurement Protocol — HTTP endpoint for sending GA4 events from a server: refunds, offline conversions, subscription renewals. Needs the
G-ID plus an API secret, and aclient_idto join the event to the browser user. It augments tagging, it doesn’t replace it — Google’s docs say a tag must already be collecting — Offline Conversion Imports - Firebase SDK — the app equivalent of the Google tag. A GA4 property’s app data streams are fed by it
Analysis
- GA4 — the property: event-based model, reports, explorations, thresholds, custom dimensions. Everything about the data model lives in GA4
- BigQuery — the raw-event export from GA4, one row per event. Where questions the GA4 interface can’t answer get answered — BigQuery
- Data Studio (Looker Studio 2022–26) — free dashboards over GA4, BigQuery, Sheets and connectors — see BigQuery for its query-cost behaviour
Advertising
- Google Ads — conversion tracking via the Google tag (
AW-) and conversion labels; enhanced conversions send hashed first-party data (email, phone) with the conversion to improve matching. Imports GA4 conversions as an alternative to its own tag - Google Marketing Platform — the enterprise suite: CM360 (with Floodlight,
DC-IDs), DV360, SA360, and the 360 tiers of Analytics and Tag Manager. Names to recognise unless you’re in an agency or a large advertiser
Consent
- Consent Mode — four signals the Google tags read before sending:
ad_storage,analytics_storage,ad_user_data,ad_personalization. Set a default on load (deniedfor UK/EEA), update when the banner is answered - Basic vs advanced: basic loads no Google tags until consent; advanced loads them and sends cookieless pings while denied, which Google uses for Modelled Conversions. Whether advanced is acceptable under PECR (Privacy and Electronic Communications Regulations) is a legal judgement — UK GDPR and PECR for Analytics
- CMP integration — the banner vendor’s GTM template sets defaults and calls the update. The CMP decides; Consent Mode only carries the decision to Google’s tags. Non-Google tags in GTM need their own gating — Consent Management
// page code, ABOVE the GTM or gtag snippet — order is the whole trick
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
ad_storage: 'denied', analytics_storage: 'denied',
ad_user_data: 'denied', ad_personalization: 'denied',
wait_for_update: 500 // ms to wait for the CMP before tags fire
});
// later, the CMP calls gtag('consent', 'update', { analytics_storage: 'granted', ... })Choosing
| Situation | Use | Why |
|---|---|---|
| Brochure site, GA4 only, nobody will add vendors | Google tag, hardcoded | One script. A container adds a request and a UI for nothing |
| GA4 + Ads, developer owns tracking, releases are cheap | Google tag, hardcoded, destinations combined in tag settings | Still one library; Ads is a destination, not a new integration |
| Any non-Google vendor, or marketing needs to ship without a release | GTM + data layer | The point where (b) above pays back |
| Consent must gate many vendors from one place | GTM | One consent check for every tag — Tag Managers |
| Heavy ad spend, ad-blocker losses, cookie lifetime, or PII (personally identifiable information) must be stripped before vendors | GTM + server-side GTM | One first-party stream in; you control what leaves |
| Want first-party serving without running a server | Google tag gateway | Cheap partial win; Google tags only |
| Revenue confirmed off-site (refunds, phone orders, renewals) | Measurement Protocol alongside tagging | Server truth, joined by client_id |
The default for a commercial site is the third row. The mistake is the first row’s tooling on the third row’s site.
Where it hurts
- “Google tag” means three things. The library (gtag.js), the configuration object in GA4/Ads admin that holds a tag ID’s settings and destinations, and the tag type in GTM that loads the library. Same name, different screens
- The Google tag in GTM vs the GA4 Event tag. The Google tag tag configures the destination and sends
page_view; GA4 Event tags send everything else. Since September 2023 event tags don’t reference the config tag — each takes the measurement ID. Deleting the Google tag to “clean up” kills page views - Settings outside the container. The Google tag settings in GA4’s data stream screen — cross-domain, internal traffic, which automatic events fire — apply wherever that
G-ID loads, including inside GTM. A GTM-only team can be surprised by behaviour configured in GA4 - Enhanced measurement fires events nobody configured.
page_view(including on single-page application (SPA) history changes),scrollat 90%, outboundclick,view_search_results, YouTubevideo_*,file_download,form_start/form_submit. A team adding its own scroll or form tracking in GTM double-counts these; a single-page app with history-change page views and a GTM virtual-page-view tag counts every route twice - Hidden hardcoded copies. Ecommerce platforms and CMS (content management system) plugins install a Google tag of their own — see When both are installed
- Two consent systems. Consent Mode governs Google’s tags; everything else in the container needs its own consent trigger. A green Consent Mode audit says nothing about the Meta pixel
- Reports that disagree by design. GA4 conversions, Ads conversions and Floodlight count with different attribution, windows and modelling — Tool Discrepancies
- Debugging spans three tools. Tag Assistant for what fired, GA4 DebugView for what arrived, BigQuery for what was stored — Instrumentation Debugging
Related
- Google Tag Manager — container internals
- GA4 — the data model and reports
- Hardcoded vs Tag-Managed Tracking — the vendor-neutral version of the three-ways choice
- Tag Managers · The Data Layer — the concepts under GTM and the queue
- Server-Side Tag Management · Client-Side vs Server-Side Tracking — the server hop
- Consent Management · Modelled Conversions — what Consent Mode feeds
- Tag Manager Performance — what the container costs the page
- Adobe Experience Cloud — the same orientation for Adobe