When the Google tag never arrives
A content blocker can drop the analytics script while the page's own beacon still lands. Here's how to tell the two apart, what the gap does and doesn't measure, and why first-party isn't a loophole.
Count page views in your analytics tool, then count the same pages in your server logs. The numbers almost never match. There are plenty of reasons, and one of the most common is simple: some browsers never ran the analytics script at all.
The blocking lab on this site measures that gap for its own visitors. This note explains how it decides whether the Google tag loaded, what it stores, and what the resulting percentage can and can't tell you.
Two requests, two fates
A consented visit to the lab produces two kinds of requests. The Google tag is third-party: its script comes from googletagmanager.com, and its hits go to google-analytics.com. The lab's own beacon is first-party: a POST to /api/blocking on this site's origin.
A content blocker judges each request on its own. Blockers work from filter lists such as EasyList and EasyPrivacy, and EasyPrivacy describes its job as removing "web bugs, tracking scripts and information collectors." A typical rule looks like ||example.com^, which in Adblock Plus filter syntax matches a domain and all of its subdomains. A well-known analytics host is an easy, stable target for a rule like that. A path on your own domain is harder to target, because it's different on every site.
So the script can be dropped while the page's own beacon still arrives. That difference is what the lab counts.
Why "is gtag defined?" is the wrong test
The obvious check is to ask whether window.gtag exists. It almost always does, even when the script is blocked.
Google's own consent mode setup guide has you define the function inline, before the library loads:
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
That function is a stub. It pushes commands onto an array and waits for gtag.js to arrive and process them. If the script never arrives, the stub keeps working, the queue keeps growing, and nothing is sent. The lab points this out in its own words: the inline gtag is this site's stub, and it exists whether or not Google's script shows up.
How the lab actually checks
The check has two steps.
First, look at what already happened. The lab reads Resource Timing entries for the page with performance.getEntriesByType("resource") and looks for a gtag/js request. If one has a body (decodedBodySize above zero) or an HTTP status between 200 and 399, the tag loaded.
That evidence is often missing even when nothing was blocked. For cross-origin requests, the browser reports size and timing details as zero unless the other server sends a Timing-Allow-Origin header. responseStatus is 0 when the CORS check fails, and MDN marks it as not yet available in some widely used browsers. A missing number doesn't prove a block.
Second, ask the network directly. If the timing data is inconclusive, the lab calls fetch() on the tag's URL with mode: "no-cors", cache: "no-store", and a four-second timeout. According to MDN's RequestInit reference, a no-cors response is opaque: the page can't read its headers or body, and its status is always 0. The lab doesn't need any of that. It only needs to know whether the promise resolved (some server answered) or rejected before a response (the request never got out). A rejection is the usual sign of a content blocker.
It's not the only cause, though. A request that's still waiting after four seconds is aborted and counts as blocked too, and so does a network that filters the domain at the DNS level.
That fetch does not wait for consent. probeTag runs when the lab mounts, and the consent check happens only after it returns. The check skips the first-party beacon and the analytics event when measurement is off. It does not skip the probe. This site also does not inject gtag.js until measurement consent is on, so before Accept the Resource Timing list is usually empty and the request to googletagmanager.com still goes out.
Counting the gap without collecting people
When measurement consent is on, the page sends one small first-party request with two fields: the consent state and whether the tag loaded. The server then:
- Refuses the request if it carries
Sec-GPC: 1, the Global Privacy Control header. - Refuses it if consent isn't
granted. - Checks for a 12-hour,
httpOnlycookie. If it's there, the browser was already counted, so it returns the totals without adding to them. - Otherwise it increments a
beaconcounter, and aga_loadedcounter too if the tag loaded.
That's the whole record: two integers. There's no row per visitor, no URL, and no IP address. The blocked share is (beacon − ga_loaded) / beacon.
The lab also sends a blocking_view event to Google Analytics with an analytics_blocked flag. Think about which browsers can deliver that event: only the ones where the tag loaded. Google Analytics can't report its own absence, which is exactly why the first-party counter exists.
What the percentage does and doesn't mean
The number on the lab is honest, but narrow:
- It only covers people who said yes. Visitors who decline measurement, or whose browser sends GPC, are in neither count. If people who run blockers also decline more often, the real share among all visitors could be different, and this page has no way to know.
- It only covers this page. The lab says so directly: it describes browsers that opened the blocking lab, not every visit to the site.
- It counts browsers per 12 hours. Not people, and not visits.
- The sample is small. On a personal site, a few visits can swing the percentage a lot.
- "Blocked" lumps causes together. A browser extension, a privacy-focused browser, a DNS filter, and a slow connection all land in the same bucket.
Read it as "among consenting visitors to this page, this share didn't load the Google tag," and stop there.
First-party isn't a loophole
The tempting conclusion is to route everything through your own domain so blockers can't see it. There are two problems with that.
The first is technical. Filter lists can target first-party requests. Adblock Plus syntax has a $~third-party option that restricts a rule to first-party requests, and a ping type that covers navigator.sendBeacon(). Path patterns match on any host. A first-party endpoint survives because no list targets it today, not because no list can.
The second matters more. A blocker is often a person's choice about tracking. Consent and GPC still apply no matter whose domain the request goes to. The GPC spec itself says it isn't designed to cover data collection within the same context. This site honors it on that endpoint anyway, because that's what the visitor asked for. A first-party beacon is a better way to measure the people who said yes. It isn't a way around the people who said no.
Try it
- Open the blocking lab with measurement consent on and no blocker. It should say the Google tag is reachable.
- Turn on a content blocker with a privacy list such as EasyPrivacy, and reload. The status should flip to blocked. In your browser's developer tools, the Network panel shows the
gtag/jsrequest failing, while the request to/api/blockinggoes through. - Reload again. The counters won't move, because this browser was already counted in the last 12 hours.
- Then open the Collection Lab and look at its network panel, which groups the same requests into first-party and third-party.
More on the request list and the beacon: What a beacon actually sends.
Sources
- EasyList overview (EasyList and EasyPrivacy filter lists)
- How to write filters, Adblock Plus Help Center
- Set up consent mode on websites, Google for Developers
- PerformanceResourceTiming: responseStatus, MDN
- Timing-Allow-Origin header, MDN
- RequestInit (fetch options), MDN
- Global Privacy Control specification, W3C
Labs that show this
- When the Google tag is blocked
When the Google tag is blocked, this page says so for this browser and shows the share of lab visitors whose tag did not load. Free, and the check stays here.
- Free Google Analytics labs
Free Google Analytics labs in this browser. See what a page collects, what a beacon sends, and how those signals personalize what you see. Open one.
- Consent Mode and Global Privacy
Consent Mode and Global Privacy Control on this site: what is sent before Accept, what changes after, and how a GPC signal keeps measurement off.
Recommended next
Why these picksReading path transitions…