Dead _gat._getTrackers() call
Tags use the _gat._getTrackers() method from the legacy ga.js library. This library is no longer loaded, so these calls fail silently.
Summary
- rule_id —
gat-get-trackers - purpose — Detect tags calling
_gat._getTrackers(), a method from the retired ga.js library - effect — Silent runtime failure; the call returns nothing because ga.js is no longer loaded
- layer — container
- reversibility — non-destructive
What fires this
The rule checks active Custom HTML tags for codeAnalysis.hasGatGetTrackers, set by the parser when it finds a _gat._getTrackers call in the tag code. Every matching tag is flagged. The _gat object belongs to ga.js (Universal Analytics classic), which Google retired in 2023 and no longer serves. Paused tags are excluded from the check.
Why it matters
_gat._getTrackers() returns an array of tracker objects from ga.js. Because ga.js is not loaded on any modern site, the call throws or returns undefined, and any dependent logic fails silently. No error surfaces in the GTM preview console; the tag appears to fire but does nothing. This is undetected dead code that can mask measurement gaps in containers that haven't completed the UA-to-GA4 migration.
Before / after
// Custom HTML tag — UA era
var trackers = _gat._getTrackers()
trackers[0]._trackEvent('Video', 'play', videoId)
// GA4 equivalent via gtag.js
gtag('event', 'video_play', {
video_id: videoId
})
Remediation
- Open each flagged tag in GTM.
- Confirm ga.js is not loaded anywhere in the container or page source.
- Identify what the
_gat._getTrackers()call was intended to do (event tracking, cross-domain linker, custom dimensions). - Re-implement the equivalent measurement in GA4 using
gtag('event', ...)or a GA4 Event tag in GTM. - If the functionality is no longer needed, delete the tag entirely.
- Remove any variables or triggers that existed solely to support the deleted tag.
Metadata
- Severity
- critical
- Tier
- error
- Category
- dead-code
- Layer
- container
- Version
- 1
- Effort
15min(about 15 minutes)- Reversibility
- non-destructive
See also
- Dead-code rules — other rules in this category
- Health score — how this rule contributes to the score
- Rules catalog — browse all rules
Examples
curl https://developer.tagmanifest.com/v1/evaluate-rule \
-H "Authorization: Bearer $TM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"rule_id":"gat-get-trackers","url":"https://example.com"}'
User: Run gat-get-trackers on https://example.com
# Tool call
{
"tool": "evaluate_rule",
"arguments": {
"rule_id": "gat-get-trackers",
"url": "https://example.com"
}
}