The Google tag is a single piece of code that a website carries on every page so that Google’s products can see what visitors do. Its technical name is gtag.js. Once it is in place, it records page views and a range of other actions, and sends them to the products it is connected to, usually Google Analytics 4 and Google Ads. It replaced a tangle of separate snippets with one tag that can serve several destinations, which is why nearly every business site that advertises on Google carries one, whether the owner knows it or not.
In short
- One piece of code, gtag.js, on every page of a site.
- Sends visits, events and conversions to Google products.
- One tag can serve Analytics and Google Ads together.
- Sends data only to Google, unlike Tag Manager.
What it actually does
When a page loads, the tag runs in the visitor’s browser and reports what happened. Some of that it detects on its own. Google’s settings let the tag record scrolls, clicks on links leading off the site, form interactions, video engagement and file downloads automatically, alongside every page view.
Anything beyond that, such as a booking confirmed or a quotation requested, has to be defined as an event and marked as mattering. Our page on Google Analytics 4 explains how those events become the numbers in a report.
Tag IDs and destinations
Every Google tag has an ID, a short code that tells the browser which tag to load. Examples look like G-XXXXXXX, AW-XXXXXXX or GT-XXXXXXX. In practice an ID starting with G belongs to an Analytics property, and one starting with AW to a Google Ads account. A business that has moved agencies a few times often finds several IDs on the same site, some of them sending data to accounts nobody at the business can open any more.
Google calls the products a tag sends to its destinations. A single tag can be connected to several of them, so one installation feeds both Analytics and Google Ads. The catch is that settings are shared: change something in the tag and every destination connected to it is affected. Before anybody edits the tag for one product, check what else it feeds.
Google tag or Tag Manager
The two are easily confused, and Google’s own guidance draws the line clearly.
- The Google tag suits a site that only needs Google’s standard measurement and has nobody to manage tags. Google describes it as a tag you set up once.
- Google Tag Manager is a container that can hold the Google tag and tags from other companies, such as the Meta Pixel. Google recommends it for anybody who needs more control.
The Google tag can send data only to Google services. A business that also advertises on Facebook or TikTok usually ends up with Tag Manager, with the Google tag running inside it.
The settings worth knowing
The tag’s settings live in the Google Ads or Analytics admin rather than in the website code.
- Automatic event detection, which turns the built-in events on or off. Page views cannot be switched off.
- Domains, for a business whose visitors move between two of its own sites, such as a main site and a separate booking system.
- Internal traffic, so visits from the office are labelled and kept out of reports.
- Unwanted referrals, such as a payment page that would otherwise claim the credit for a sale.
- User-provided data, which sends hashed contact details to improve conversion matching.
- Consent defaults, covered below.
Consent comes first
The Google tag has consent checks built in. It reads the choice a visitor made on the site’s consent banner through Consent Mode, and changes what it sends. In the basic setup, nothing is sent until the visitor agrees. In the advanced setup, the tag loads but sends cookieless signals while consent is denied. Our page on Consent Mode sets out the difference.
None of that works if the banner loads after the tag, or never passes the answer on.
Where installations go wrong
- Two tags on the same page, one pasted in by a plugin and one by a developer, so every visit counts twice.
- Old snippets left behind, still sending to an account nobody uses.
- The tag missing from some templates, such as the checkout or the thank you page, which are the pages that matter most.
- An agency’s ID in the code, sending your data to an account you cannot open.
- Shared settings changed for one product, quietly altering what another receives.
Checking your own site
Google’s Tag Assistant shows whether a tag is on a page, which IDs it loads and which events it sends. Open your homepage and your contact or checkout confirmation page, since a tag present on one and missing from the other is a common fault. After installing a new tag, allow up to thirty minutes for data to begin arriving before deciding something is broken.
Tag Assistant also shows tags firing from somewhere you did not expect, such as a theme, a chat widget or a booking plugin that adds its own copy. Then check who owns each ID you find. Every Analytics property and Google Ads account the tag sends to should belong to the business, with at least two people able to sign in.
Words you will hear
- gtag.js. The technical name of the Google tag.
- Tag ID. The code that identifies which tag a page loads.
- Destination. A Google product receiving data from the tag.
- Event. One recorded action, such as a page view or form sent.
- Global site tag. The older name for the same code.
- Tag Assistant. Google’s tool for checking a tag on a live page.
Open Tag Assistant on your own thank you page today. If no Google tag fires there, your adverts are being judged without the one number that matters.
Questions we get
More about google tag
What is the Google tag?
What is the difference between the Google tag and Google Tag Manager?
What does a Google tag ID look like?
Can one Google tag send data to Analytics and Google Ads?
How do I check that the Google tag is working?
Was the Google tag once called the global site tag?
Does the Google tag respect cookie consent?
Related terms
Google Tag Manager
Google Tag Manager holds the tracking code for your site in one place, so tags can be added, tested and switched off without touching the website.
Google Analytics 4
Google Analytics 4 is the free tool recording what people do on your website and app, built around events rather than around page views and sessions.
Consent Mode
Consent Mode passes a visitor's cookie choice to Google tags, so analytics and advertising tags adjust their behaviour instead of ignoring the answer.