Skip to main content
TagManifest /Docs Dashboard

Dead code rules

Checks that detect Universal Analytics remnants, legacy ga.js API calls, UTMz cookie references, and paused tags that have accumulated as cleanup debt.

On this page 5

Dead code rules catch JavaScript that executes but accomplishes nothing. The two main clusters are Universal Analytics remnants — API calls, queue pushes, and cookie reads targeting a platform that stopped accepting data in July 2023 — and maintenance debt in the form of paused or flagged tags that never got removed.

Every finding in this category is safe to delete. There are no tradeoffs to weigh and no dependencies to untangle. The audit surfaces them; the fix is deletion.

What this category covers

Universal Analytics was sunset by Google in July 2023. Properties stopped collecting data. But the client-side code persists: custom HTML tags that call ga('send', ...), push to _gaq, or invoke _gat._getTrackers() continue to execute on every page load. They send requests to endpoints that no longer accept data. They produce no browser errors and no visible failures. They look like working tracking code.

Tags that read the __utmz cookie have a different failure mode. The __utmz cookie was set by the legacy ga.js library (urchin.js), which Google deprecated in 2014. Those cookies haven't been written by any active system since then. Tags that read __utmz always get an empty or null value. If that value feeds attribution logic, the logic silently fails on every session.

Paused tags are inert — they don't fire. But they represent cleanup debt. Each paused tag was once active and was disabled rather than removed. In a large container, accumulated paused tags make it harder to understand the container's actual active surface area. They also create audit confusion: it's not always clear whether a tag is intentionally paused or accidentally left behind. The 6-month threshold for stale-paused-tags is conservative by design.

tags-marked-for-removal catches a different signal: active tags whose names include markers like [Remove], [Delete], TODO, TEMP, or DEPRECATED. These tags are still firing. The name is evidence that someone already identified them for removal and didn't follow through.

How findings are tiered

The four UA-remnant rules (utmz-reference, gat-get-trackers, gaq-push, ua-send) are all errors. Active tags executing dead API calls against a sunset platform are a functional failure, not a style issue. They carry the highest deduction weight in the category.

stale-paused-tags is an optimization. Paused tags don't fire, so there is no active breakage — but the accumulation of inert code degrades container clarity and signals deferred maintenance.

tags-marked-for-removal is an info finding. It identifies likely candidates for removal without asserting that anything is currently broken.

See Health score for deduction weights and tier math.

Rules in this category

Errors

  • utmz-reference — Tags read the __utmz cookie, which hasn't been set by any active system since ga.js was deprecated in 2014.
  • gat-get-trackers — Tags call _gat._getTrackers() from the legacy ga.js library, which is no longer loaded. These calls fail silently.
  • gaq-push — Tags push events to _gaq, the legacy ga.js async queue. ga.js has been deprecated since 2014. These calls do nothing.
  • ua-send — Tags call ga('send', ...) from analytics.js (Universal Analytics). UA was sunset in July 2023. Data goes nowhere.

Optimizations

  • stale-paused-tags — One or more tags have been paused for over 6 months. Tags inactive that long are almost certainly no longer needed.

Info

  • tags-marked-for-removal — Active tags have names containing [Remove], [Delete], TODO, TEMP, TEST, DEPRECATED, or similar markers. They are still firing.

Not yet shipped

  • stale-domain-references — Tags reference domains that may no longer be active. It is listed in the catalog with status deferred. It produces no findings today and has no rule page.

Common patterns

The most common dead-code pattern is the incomplete UA migration. A team adds GA4 tags to the container and stops. The old UA tags remain active. The container now runs both GA4 tracking and UA tracking — but only GA4 sends data anywhere. The UA tags fire on every page load and produce no output. Because there's no browser error and no missing data in GA4, the dead UA code can persist for years without being noticed.

The paused-tag pattern usually reflects a decision made under time pressure. Someone disabled a tag that was causing a problem — a conversion tracking conflict, a pixel firing twice — with the intention of cleaning it up later. Later never came. In large containers with long histories, it's common to find 10–20 tags in this state, some paused by people who no longer work at the company.

tags-marked-for-removal surfaces a specific moment in the audit workflow: someone ran a container review, flagged tags for deletion in their names, and didn't finish the cleanup. The tag name becomes the record of the intention. The audit reads that record and closes the loop.

See also

  • Health score — how findings in this category translate to score deductions
  • Rules catalog — browse all rules across all categories
  • Organization rules — adjacent category covering naming, folder structure, and container hygiene

Examples

Filter to this category
curl https://developer.tagmanifest.com/v1/scan-url \
  -H "Authorization: Bearer $TM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","category":"dead-code"}'