A site tag is the one block of JavaScript an advertising or analytics platform asks a website owner to place on every page, so the platform can recognise returning visitors and record what they do. One snippet, installed once, everywhere. Page views, purchases, form submissions and audience membership all travel through it.
The dominant meaning in search and display advertising belongs to Google. The global site tag, shipped as a file named gtag.js, arrived in October 2017 and kept that name until August 2022, when it became the Google tag. Microsoft runs the same pattern under the name Universal Event Tracking, Meta under the name Pixel, LinkedIn under Insight Tag. The engineering is close enough that practitioners use the generic label for all of them.
The arrangement exists because the alternative was unmanageable. Each Google measurement product once carried its own library, and each conversion action its own snippet, so a site running search ads, remarketing and analytics accumulated three or four unrelated scripts plus a fresh block of code for every new goal. Sitewide tagging collapses that into one library with a command interface.
What the snippet actually does
The installed code has two parts. An asynchronous script element points at googletagmanager.com with a tag ID in the query string, and an inline block initialises a global array called the data layer, defines a function named gtag that pushes its arguments onto that array, timestamps the load, and issues a configuration command. Commands can be queued before the library finishes downloading, which is why the order on the page matters less than it appears.
Once loaded, the library reads the queue. Six commands exist: js, config, event, set, get and consent. The config command names a destination, and destinations are identified by prefix. G- addresses a Google Analytics property, AW- a Google Ads account, DC- a Floodlight advertiser, GT- a Google tag itself. Several config lines can follow a single library load, which is how one snippet feeds analytics and ads at once.
The event command carries the payload. Google publishes a list of recommended event names, purchase and add_to_cart among them, each with defined parameters for value, currency and item arrays. Google Ads conversion actions additionally require an event snippet on the converting page, whose send_to value concatenates the conversion ID and a conversion label.
The get command reads values back out of the library, among them the Analytics client identifier, the session identifier and the Google click identifier. That surface was extended in September 2025 when gtag.js gained access to the session number, an incrementing count of how many sessions a user has had, previously available only in Tag Manager custom templates.
The consent command governs whether storage happens at all, through four parameters: ad_storage, analytics_storage, ad_user_data and ad_personalization. Defaults are declared before any measurement command fires, then updated when a visitor interacts with a consent banner.
Cookies are written under the site's own domain. Analytics keeps a client identifier; the Google Ads path stores the click identifier appended by auto-tagging so a later conversion can be matched to the click that produced it. Microsoft does the same with its click identifier, which Universal Event Tracking holds for roughly 90 days. Everything downstream, bidding included, depends on that request reaching the platform.
Origin and evolution
Google Analytics went through urchin.js, then ga.js with asynchronous loading in 2009, then analytics.js with Universal Analytics in 2013. Advertising tracking sat outside that lineage entirely, on a separate conversion script and a separate remarketing script.
October 2017 merged the two lines. The global site tag was published as sitewide code that wrote advertising cookies in a first-party context, which mattered because Apple had shipped Intelligent Tracking Prevention weeks earlier and third-party cookie lifetimes were being cut. Microsoft had reached the same conclusion three years before: Universal Event Tracking was announced on 23 October 2014 at the Bing Ads Next event in Redmond as one tag covering conversion goals and remarketing lists. Bing then made click identifier auto-tagging mandatory in January 2018, citing the same Safari change.
Google Marketing Live in May 2022 previewed a rename, and on 2 August 2022 the global site tag became the Google tag. Existing installations converted without a code change; what changed was the interface above them, with settings, destinations and access control moved into dedicated screens in Google Ads and Analytics. The unified tag identifier that followed let one ID connect a site to several measurement products at once.
Deployment then moved to the network layer. Google released First-Party Mode for Tag Manager on 17 July 2024, added a Cloudflare beta on 9 October 2024, and on 8 May 2025 brought the architecture to general availability as the tag gateway, claiming an 11% uplift in observed signals. Akamai followed in January 2026, Fastly in April 2026 with a 14% figure, and Google Cloud reached general availability on 1 June 2026. None of this alters what the tag does in the browser. It alters the address the browser fetches it from.
Why the tag matters commercially
Automated bidding consumes conversions as an input, so a gap in tag coverage is not a reporting inconvenience but a budgeting one. Google now packages sitewide deployment as the first of four steps in its data strength framework, ahead of account linking and server-side feeds.
The consequences of a tag that loads but transmits nothing are documented. After Google began enforcing consent signals for advertisers serving the European Economic Area in July 2025, one account's conversions collapsed by roughly 90% overnight because the consent banner was collecting choices without passing them to the tag layer. Around 40% of the lost attribution was recoverable after the fix. The rest was gone.
Configuration authority has narrowed too. On 15 June 2026 Google Signals lost its role as a controller of advertising data, leaving the consent parameter set in the tag as the governing mechanism.
Limitations and disputes
Blocking is the structural problem. Filter lists historically targeted Google-owned hostnames, which first-party serving was meant to evade, but by May 2026 blockers were naming server-side container subdomains individually: one AdGuard list carried more than 3,400 rules against first-party tracking subdomains, including 83 entries matching a gtm prefix and 42 matching an sgtm prefix. A monitoring service, isblocked.fyi, surfaced in June 2026 so operators could check their own hostnames against 22 major lists. Mariusz Brucki, a server-side tracking consultant at TAGGRS, put the resulting shortfall at between 5% and 40% of collected data, depending on the audience.
Browsers are moving further down the stack. A source-code review of WebKit found that Safari 27 blocks outbound connections by destination IP address, independent of which domain served the script, with the Bing endpoint and the LinkedIn Insight Tag among those identified. A first-party proxy does not help against a check applied to the destination.
European law constrains the tag before any of that. The Verwaltungsgericht Hannover ruled on 19 March 2025 that a tag manager cannot activate before explicit consent, after testing showed device data including IP addresses reaching US servers on page load.
Then there is the arms race objection. Google added randomised serving paths in May 2026 to hide container identifiers from filter lists, and blockers adapted. Critics argue that concealment is not a measurement strategy, and the IAB Tech Lab has proposed a shared server-side alternative, ECAPI, rather than a per-platform browser script for each buyer.
Adjacent terms
A tag management container is not a site tag. It is a loader that fetches a configuration and fires tags according to triggers; the site tag can be one of the things it fires.
An event snippet sits on specific pages and reports a single action. The site tag must already be present for it to work.
A tracking pixel in the strict sense is a one-by-one image whose request logs a visit. It executes no code and reads nothing from the page.
A conversions API carries the same events from a server rather than a browser, with a shared event identifier used to deduplicate against the tag.
Recent developments
A Google help page dated 20 August 2026 set out three changes to the tagging stack: a redesigned interface, the merger of the Google tag into Tag Manager containers, and point-and-click conversion setup. Optimised containers stop loading gtag.js as an extra fetch and send data to Google destinations directly. Matteo Zambon assessed the visual tool the following day as covering the easy 70 to 80% of cases, leaving the harder configurations where they were.
Server-side paths kept widening in parallel. Microsoft published full documentation for a conversions API on 4 August 2026, running the same event model as its browser tag but gated behind per-account approval. Meta had already made its server-side setup a one-click option in April 2026 alongside AI-assisted enrichment of pixel events.
The direction is consistent. The site tag is no longer the whole measurement path, and it is no longer expected to survive intact. It remains the component everything else is reconciled against.
Timeline
- 2009: Google Analytics ships ga.js with asynchronous loading
- 2013: analytics.js arrives with Universal Analytics
- 23 October 2014: Bing Ads announces Universal Event Tracking at the Bing Ads Next event in Redmond
- September 2017: Apple ships Intelligent Tracking Prevention in Safari
- October 2017: Google introduces the global site tag, gtag.js, for sitewide advertising and analytics measurement
- January 2018: Bing Ads makes click identifier auto-tagging mandatory
- 24 May 2022: Google Marketing Live previews the rename of the global site tag
- 2 August 2022: The global site tag becomes the Google tag, with existing installations converting automatically
- November 2023: Consent mode adds ad_user_data and ad_personalization to the parameter set
- 17 July 2024: First-Party Mode is released for Google Tag Manager
- 9 October 2024: First-party mode enters beta with Cloudflare integration
- 19 March 2025: The Verwaltungsgericht Hannover rules that a tag manager requires consent before activation
- 8 May 2025: First-party mode reaches general availability and is renamed the tag gateway for advertisers
- July 2025: Google begins enforcing consent signals for European Economic Area advertisers
- September 2025: The gtag.js get command gains access to the Analytics session number
- 29 January 2026: Akamai joins the tag gateway integrations
- April 2026: Fastly adds tag gateway support
- 11 May 2026: Documentation formalises randomised serving paths that conceal container identifiers
- 20 May 2026: Google announces the merger of the Google tag and Tag Manager
- 31 May 2026: Ad blocker filter lists are found naming server-side container subdomains individually
- 1 June 2026: The tag gateway reaches general availability on Google Cloud
- 15 June 2026: Consent mode becomes the sole governing mechanism for advertising data in Analytics
- July 2026: A WebKit review identifies network-layer blocking of advertising endpoints in Safari 27
- 4 August 2026: Microsoft publishes conversions API documentation as a per-account pilot
- 20 August 2026: Google documents container optimisation, unification and visual tagging
Related PPC Land coverage
- Explaining auto-tagging - How click identifiers are appended to landing page URLs and stored by site tags on arrival.
- Google enhances gtag.js API with session number tracking capability - The September 2025 extension of the get command beyond session and client identifiers.
- Google Tag ID: Key to unified website tracking across Google products - The single identifier connecting one site to several Google measurement products.
- Bing Ads now requires auto-tagging with the Microsoft Click ID in ad URLs - The January 2018 mandate and its stated cause in Safari tracking restrictions.
- Google introduces tag gateway to improve ad tracking accuracy - First-party serving reaching general availability with Cloudflare and an 11% signal figure.
- Fastly brings Google tag gateway to its CDN, promising 14% signal uplift - Routing conditions, backend host configuration and the second vendor uplift claim.
- Google tag gateway for advertisers hits general availability on Google Cloud - The fourth deployment pathway and its place in the wider consolidation.
- Explaining data strength - The four-step framework that begins with sitewide tag deployment.
- Consent Mode V2 enforcement is silently breaking Google Ads conversions - The account that lost roughly 90% of conversions to a banner that never reached the tag layer.
- Google Signals loses ad data control on June 15 - what it really means - Consent parameters becoming the sole authority over advertising data in Analytics.
- Ad blockers are now targeting server-side GTM subdomains by name - Filter list rule counts and the collapse of the first-party evasion assumption.
- isblocked.fyi: the tool that shows if adblockers are silently killing your data - Hostname monitoring across major blocker lists and the data gap estimate.
- Safari 27 blocks LinkedIn and Bing ad trackers by IP address - Network-layer blocking independent of the domain that served the script.
- German court ruling on cookie consent could impact tag management practices - The Hannover judgment on activation before consent.
- Explaining ECAPI - The IAB Tech Lab standard proposing one server-side event interface in place of per-platform scripts.
- Google's visual tagging covers the easy 70 to 80% of cases, Zambon says - Container optimisation, unification and the limits of point-and-click setup.
- Microsoft gates its new Conversions API behind per-account pilot approval - A server-side path mirroring the browser tag's event model, restricted to enrolled accounts.
- Meta upgrades Pixel and Conversions API to close the gap for small advertisers - Automated enrichment of browser pixel events and one-click server-side setup.
Summary
Who. Google defines the dominant implementation through gtag.js and its documentation, with Microsoft, Meta and LinkedIn operating equivalents. Advertisers, their agencies and analytics engineers install and maintain the code; browser vendors, filter list maintainers and European data protection authorities constrain what it may do.
What. A site tag is a sitewide JavaScript snippet that loads a measurement library, opens a command interface for configuring destinations and sending events, writes first-party cookies, and transmits visitor activity to an advertising or analytics platform.
When. Microsoft shipped the sitewide pattern in October 2014, Google in October 2017 as the global site tag, renamed the Google tag on 2 August 2022 and scheduled for absorption into Tag Manager containers under an announcement documented in August 2026.
Where. Execution stays in the visitor's browser. Delivery has moved: scripts and event traffic can now be routed through an advertiser's own domain via content delivery network or cloud integrations, and duplicate event streams increasingly originate from advertiser servers instead.
Why. Automated bidding, audience building and attribution all consume events the tag reports, so coverage gaps translate directly into worse campaign decisions. That same centrality explains the pressure on it from blockers, browser engines and consent law, and the industry's steady migration of the same events onto server-side transport.
Discussion