The Google tag (gtag.js) explained: G-, AW- and GT- IDs
6 min read
The Google tag is the single snippet that feeds GA4, Google Ads and other Google products. Here is what G-, AW- and GT- IDs mean, and how to tell whether yours is installed once or twice.
If your scan shows a card titled G-AB12CD34EF or GT-ABC1234 with “Google tag” underneath it, you are looking at the piece of code that feeds most of Google’s measurement products on your site. It is the modern replacement for the separate analytics and advertising snippets sites used to carry. Paste your page into Tag Explorer to see this tag on your own site.
The Google tag, loaded as a file called gtag.js, is one library on the page that can send data to several Google products at once. Which products it feeds is decided entirely by the ID or IDs it is given. That is why Tag Explorer puts the ID on the front of the card: the tag type tells you what the code is, and the ID tells you where the data goes.
What it actually does
When a page loads, the Google tag does three things. It loads the measurement library, it initialises whatever IDs it has been configured with, and it sends the automatic page view. After that it sits and waits for events, either the ones Google collects by itself or the ones you send deliberately.
The important word is unified, and it is the word Google’s own tag platform documentation uses for it. Before the Google tag, a site running analytics and advertising carried two separate snippets that each loaded their own code and each set their own cookies. The Google tag is one library serving both, so a visitor downloads less, the cookies are shared, and an ad click recorded on arrival is still available when a form is submitted twenty minutes later.
It also handles consent signalling. The Google tag reads Consent Mode v2 state, which is how a consent platform tells Google’s tags what a visitor has agreed to. Where consent rules apply to your traffic, Google’s advertising products expect those signals to be present.
What the ID means
The Google tag is always addressed by at least one ID, and the prefix tells you which product you are talking to:
G-XXXXXXXXXXis a GA4 data stream, which is normally one website.AW-XXXXXXXXXis a Google Ads account, used for conversion measurement and remarketing.GT-XXXXXXXis a Google tag destination, which is a routing label rather than a product. You configure the destination in Google’s interface and it forwards to one or more of the IDs above.
A GT- ID is the one that surprises people. Seeing it on the page tells you the tag is installed, but it does not tell you where the data ends up, because that list lives in your Google account. If you inherited a site with a GT- ID on it and nobody can open the account behind it, you cannot know what is being fed, and that is a reason to replace it rather than leave it.
One more code is easy to mistake for this family. GTM-XXXXXXX is a Tag Manager container. It is not a measurement destination, it is the box other tags travel in, and Google’s own naming does very little to make that clear.
How it gets onto your site
There are two normal routes, and both are legitimate.
Hard coded in the page head. Someone pasted the snippet into the site template. It loads on every page, early, with no dependency on anything else. This is reliable and completely opaque: changing it means changing site code.
As a Google Tag tag inside a container. Tag Manager loads it on a trigger, usually Initialisation on all pages. This is the setup to prefer, because adding a destination or changing a setting is then a publish rather than a deployment.
The failure mode is doing both. A hard coded snippet that nobody remembers, plus a container tag added later by someone who did not check, gives you two copies of the same ID on the page and every page view counted twice.
What this looks like in Tag Explorer
Tag Explorer draws the page as a tree. Each Tag Manager container is a branch, the tags inside it are leaves under it, and anything hard coded into the page HTML sits under DIRECT ON PAGE.
The Google tag shows as a card with the ID as the title and the tag type as the subtitle. Cards are colour coded by category, so an analytics destination and an advertising destination read differently at a glance. Every card carries an info icon with a short definition and the Learn more link that brought you here.
What to look for:
- The same ID under both a container and DIRECT ON PAGE. The tool raises a duplicate banner and tints those cards red with an attention badge. This is the single most common Google tag fault.
- Two different IDs of the same family, for example two
G-IDs. The insights panel below the tree flags that as split tracking, because neither destination holds the full picture. - A
GT-ID on its own. Nothing is wrong with it, but note that the scan cannot follow it. Only the account behind it knows what it feeds.
Two limits matter here. The tool reads the published container, so a Google tag sitting unpublished in a workspace will never appear. And a scan is a static read of the page: it proves the tag is installed, not that it fired. Preview mode in Tag Manager and the Network tab in your browser’s developer tools are what prove firing.
What to do if it is missing, duplicated or dead
Missing. No Google tag card means nothing Google measures is running on that page: no analytics, no remarketing, no conversion attribution. Check the tag exists in your container, that its trigger covers every page rather than just the homepage, and that the container version was published. Scan a second page before concluding anything, because a page specific trigger is a common cause.
Duplicated. If the same ID appears twice, remove one copy, and remove the hard coded one. It is the copy nobody owns and the copy that will be forgotten again. If two different IDs of the same family appear, that is a decision rather than a cleanup: pick the account you actually report from, remove the other, and confirm the surviving ID matches what your reports use.
Dead or stale. The Google tag itself is current, so age alone does not kill it. What goes stale is the account behind the ID. A G- or AW- ID pointing at a property or advertising account nobody can log into is collecting into a black hole. The fix is to create accounts you control, install those IDs, and treat the old data as gone. A leftover Universal Analytics snippet beside the Google tag is genuinely dead and should simply be deleted.
Related guides
- Google Analytics 4 explained: the G- measurement ID
- Google Ads conversion tracking: AW- IDs and labels
- GTM containers explained: what GTM-XXXXXXX means
- Conversion Linker explained: the tag with no ID
- Universal Analytics: why it is dead
Run your own page through Tag Explorer and read the ID off the Google tag card. If it is there twice, or the ID belongs to an account nobody can open, that is exactly the sort of inherited mess our rebuilds and rescues work untangles before anything else gets measured.
Frequently asked questions
What is the difference between a G- ID and a GT- ID?
A G- ID addresses one GA4 data stream directly, so data goes to that property and nowhere else. A GT- ID addresses a Google tag destination, which is a routing label you configure in Google's interface and which can forward the same data to several IDs at once. Both are valid on a live site, but a GT- ID means the real list of recipients lives in your Google account rather than in your page code.
Is gtag.js the same thing as Google Tag Manager?
No. gtag.js is a measurement library that talks to Google products directly. Google Tag Manager is a container that loads tags of any kind, including the Google tag, based on rules you set. A container ID starts with GTM-, and it is not a measurement destination at all.
Can one Google tag serve both GA4 and Google Ads?
Yes, and that is the point of it. One loaded Google tag can carry a G- ID for analytics and an AW- ID for advertising, or a single GT- ID that fans out to both. You do not need a separate library on the page for each product.
Why does my scan show the Google tag twice?
Almost always because it is installed in two places: once hard coded in the page template and once through a tag manager container. Both copies load and both send the automatic page view, which inflates sessions and conversions. Keep the copy inside the container and remove the hard coded one.