Browser ES Module Deduplication Can Silently Misdirect Analytics Data
A developer migrating a landing page to a new domain discovered that leaving the old analytics script tag alongside the new one caused all traffic to be recorded under the wrong property for days. Browsers deduplicate ES module fetches by URL within a document, meaning two script tags sharing the same src are fetched and executed only once, with the first tag's attributes taking effect. As a result, the new analytics token was never read, and the traffic counter stayed at zero without any visible error. The issue was identified not through the analytics dashboard but by inspecting browser performance entries, which showed only a single network request for the beacon script despite two tags being present. The fix was simply removing the outdated script tag, highlighting that a metric stuck at exactly zero is a cue to audit instrumentation rather than assume no activity.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in