A week ago I wrote about the automated testing I built for GA4 and Google Tag Manager. It's moved on quickly.
It now watches client sites every night from London, tests tracking behind a login before launch, and this week it learned to catch a problem I'd never seen before: one line of a web app's code that silently stopped every GA4 page view.
- 53UK sites rescanned from a London server, so banners behave as UK visitors see them
- Nightlymonitoring of client sites, with an email only when something new goes wrong
- 1line of a web app's own code that stopped every GA4 page view behind its sign-in
- 0errors anywhere to show it: not in the console, Tag Assistant or GA4
The one line that stopped GA4 page views.
I was testing a client's web app before launch. The public pages sent a page view as soon as the visitor accepted cookies. Once signed in, the dashboard and every page after it sent nothing.
Every usual suspect came back clean. Google's own consent record showed everything granted. The Google tag loaded with the right measurement ID. A test event sent by hand from the console reached GA4 straight away. There were no console errors and no security policy errors. GA4 worked, the tag worked, consent worked, and the page view still never went.
The signed-in pages had one thing the public pages didn't: the app's main script, a single file of more than 5 MB. So I tested the page piece by piece.
Test 1
Block the app's script
The page view came back. The cause is in that file.
Test 2
Load it with defer
Still nothing. Running it later in page load isn't enough.
Test 3
Load it 10 seconds late
The page view came back. It's something the script does as it starts.
Test 4
Scan every built-in
Two of the browser's own functions were replaced, only when the script ran.
Test 5
Undo one line, then add only that line
Proof both ways.
One replacement was a harmless wrapper that sends the visitor back to sign in when a request fails. The other was this:
Array.prototype.toString = function () {
return this.join("");
};
When JavaScript turns a list into text, it puts commas between the items: String([1, 2]) gives 1,2 in every browser. The app's developers wanted lists joined without commas when building their HTML, and changing the rule once was quicker than adding .join("") wherever a list went in.
But that change applies to every script on the page, Google's tag included. Somewhere on the way to sending a page view, the Google tag relies on those commas. Without them, it never sends it, and it doesn't throw an error, so nothing tells you it's stopped.
| Test | What GA4 received |
|---|---|
| A signed-in page, as built | Nothing |
| The same page, with that one line undone | page_view and scroll |
| A public page, which never loaded the app's script | page_view |
| The same public page, with only that line added | Nothing |
The fix is small: remove the line, and add .join("") where the app needs it.
Check your own site in ten seconds.
- Open a page where GA4 numbers look low, such as a signed-in area or a checkout
- Open the browser console: F12 in Chrome or Edge, then the Console tab
- Type
String([1, 2])and press Enter
If it prints '1,2', that rule is intact. Anything else means your site's code has changed it, and your tags may be quietly losing data.
Every test now checks for this automatically. Before any of the site's scripts run, the test browser keeps a copy of the browser's built-ins, and after every step it checks which ones the site has replaced and whether everyday answers have changed.
A replacement that behaves the same isn't reported. That matters: five of the eight large UK sites I checked replace one with a working copy, through a polyfill library, and none of them has a problem.
Nightly monitoring from London.
An audit is a snapshot. Tracking breaks on a Tuesday afternoon release. So the testing now runs every night for the clients I monitor, from a server in London, so cookie banners and consent behave exactly as they do for UK visitors.
Each night is compared with the night before. If nothing new has gone wrong, nobody hears about it. If a tag starts firing before consent, a purchase event disappears or a new pixel arrives without consent settings, I get an email the next morning with the evidence, and the fix usually goes out the same day.
Sign-off testing before launch.
The best time to find a tracking problem is before it reaches a real customer. The testing can now sign in with a test account, follow a journey event by event, and check each one against the tracking plan: the right event, the right fields, the right values, sent once.
On the same client's app, it signed up, chose a plan and paid with a test card on the preview site.
It found the subscription counted again when the confirmation page was refreshed, the wrong ID sent as the transaction ID, and tax missing from the purchase. The developer fixed the first two the same week, before a single real customer saw them.
What else has changed.
New things it tests
Wider than the website on a laptop.
- iPhone and Android apps, from Firebase's own debug log and a recording of the app's traffic, with every GA4 event and parameter read in full
- Tablets, with the identity an iPad really sends, which most analytics reads as a desktop
- Google Ads and Meta accounts, through their own APIs, with read-only access
- Adobe Analytics, Adobe Target, Ensighten and first-party Tealium, alongside Google's tools
New things it catches
Problems that look fine in the reports.
- GA4 installed twice, so the same page load is counted twice
- Site code that changes the browser's built-ins, as above
- Ad platforms that ignore the browser's Global Privacy Control signal
- Server-side tagging set up in a way that loses the first-party cookies it was built for
Fewer false alarms
Every finding has to stand up.
- Serious consent findings are re-checked in a fresh browser before they're reported
- Security cookies, error monitoring tools and accessibility switches are no longer mistaken for tracking
- A slow embedded video or a redirect mid-test no longer counts as a broken page
Where it's going.
Every problem it finds on a real site becomes a check it runs on every site after. That's how the page view problem went from a puzzle on one app to a check on every scan in a day.
The machine finds it and proves it. Deciding what matters for your business, and fixing it properly, is still my job. If you'd like your site tested, the 38-point audit now starts with a full automated run.
Sources.
- MDN: Array.prototype.toString()
- MDN: Inheritance and the prototype chain
- Google: Measure page views (GA4)
- Google: Enhanced measurement events
Checked on 18 November 2026.