[{"data":1,"prerenderedAt":389},["ShallowReactive",2],{"rule-gat-get-trackers":3},{"id":4,"title":5,"body":6,"breadcrumb":352,"coderail":359,"dateModified":378,"datePublished":378,"description":379,"extension":380,"meta":381,"navigation":382,"next":378,"path":383,"prev":378,"schemaType":384,"seo":385,"stem":386,"wide":387,"__hash__":388},"docs\u002Frules\u002Fgat-get-trackers.md","Dead _gat._getTrackers() call",{"type":7,"value":8,"toc":344},"minimark",[9,16,58,63,78,82,91,95,218,222,250,254,312,316,340],[10,11,12],"p",{},[13,14,15],"strong",{},"Summary",[17,18,19,30,40,46,52],"ul",{},[20,21,22,25,26],"li",{},[13,23,24],{},"rule_id"," — ",[27,28,29],"code",{},"gat-get-trackers",[20,31,32,35,36,39],{},[13,33,34],{},"purpose"," — Detect tags calling ",[27,37,38],{},"_gat._getTrackers()",", a method from the retired ga.js library",[20,41,42,45],{},[13,43,44],{},"effect"," — Silent runtime failure; the call returns nothing because ga.js is no longer loaded",[20,47,48,51],{},[13,49,50],{},"layer"," — container",[20,53,54,57],{},[13,55,56],{},"reversibility"," — non-destructive",[59,60,62],"h2",{"id":61},"what-fires-this","What fires this",[10,64,65,66,69,70,73,74,77],{},"The rule checks active Custom HTML tags for ",[27,67,68],{},"codeAnalysis.hasGatGetTrackers",", set by the parser when it finds a ",[27,71,72],{},"_gat._getTrackers"," call in the tag code. Every matching tag is flagged. The ",[27,75,76],{},"_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.",[59,79,81],{"id":80},"why-it-matters","Why it matters",[10,83,84,86,87,90],{},[27,85,38],{}," returns an array of tracker objects from ga.js. Because ga.js is not loaded on any modern site, the call throws or returns ",[27,88,89],{},"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.",[59,92,94],{"id":93},"example","Before \u002F after",[96,97,98,176],"compare",{},[99,100,102],"compare-col",{"label":101},"Before — flagged",[103,104,109],"pre",{"className":105,"code":106,"language":107,"meta":108,"style":108},"language-js shiki shiki-themes github-light github-dark","\u002F\u002F Custom HTML tag — UA era\nvar trackers = _gat._getTrackers()\ntrackers[0]._trackEvent('Video', 'play', videoId)\n","js","",[27,110,111,120,144],{"__ignoreMap":108},[112,113,116],"span",{"class":114,"line":115},"line",1,[112,117,119],{"class":118},"sJ8bj","\u002F\u002F Custom HTML tag — UA era\n",[112,121,123,127,131,134,137,141],{"class":114,"line":122},2,[112,124,126],{"class":125},"szBVR","var",[112,128,130],{"class":129},"sVt8B"," trackers ",[112,132,133],{"class":125},"=",[112,135,136],{"class":129}," _gat.",[112,138,140],{"class":139},"sScJk","_getTrackers",[112,142,143],{"class":129},"()\n",[112,145,147,150,154,157,160,163,167,170,173],{"class":114,"line":146},3,[112,148,149],{"class":129},"trackers[",[112,151,153],{"class":152},"sj4cs","0",[112,155,156],{"class":129},"].",[112,158,159],{"class":139},"_trackEvent",[112,161,162],{"class":129},"(",[112,164,166],{"class":165},"sZZnC","'Video'",[112,168,169],{"class":129},", ",[112,171,172],{"class":165},"'play'",[112,174,175],{"class":129},", videoId)\n",[99,177,179],{"label":178},"After — fixed",[103,180,182],{"className":105,"code":181,"language":107,"meta":108,"style":108},"\u002F\u002F GA4 equivalent via gtag.js\ngtag('event', 'video_play', {\n  video_id: videoId\n})\n",[27,183,184,189,207,212],{"__ignoreMap":108},[112,185,186],{"class":114,"line":115},[112,187,188],{"class":118},"\u002F\u002F GA4 equivalent via gtag.js\n",[112,190,191,194,196,199,201,204],{"class":114,"line":122},[112,192,193],{"class":139},"gtag",[112,195,162],{"class":129},[112,197,198],{"class":165},"'event'",[112,200,169],{"class":129},[112,202,203],{"class":165},"'video_play'",[112,205,206],{"class":129},", {\n",[112,208,209],{"class":114,"line":146},[112,210,211],{"class":129},"  video_id: videoId\n",[112,213,215],{"class":114,"line":214},4,[112,216,217],{"class":129},"})\n",[59,219,221],{"id":220},"remediation","Remediation",[223,224,225,228,231,237,244,247],"ol",{},[20,226,227],{},"Open each flagged tag in GTM.",[20,229,230],{},"Confirm ga.js is not loaded anywhere in the container or page source.",[20,232,233,234,236],{},"Identify what the ",[27,235,38],{}," call was intended to do (event tracking, cross-domain linker, custom dimensions).",[20,238,239,240,243],{},"Re-implement the equivalent measurement in GA4 using ",[27,241,242],{},"gtag('event', ...)"," or a GA4 Event tag in GTM.",[20,245,246],{},"If the functionality is no longer needed, delete the tag entirely.",[20,248,249],{},"Remove any variables or triggers that existed solely to support the deleted tag.",[59,251,253],{"id":252},"metadata","Metadata",[255,256,259,260,265,259,269,273,259,276,280,259,283,286,259,289,293,259,296,300,259,306,309],"dl",{"className":257},[258],"spec-list","\n  ",[261,262,264],"dt",{"id":263},"severity","Severity",[266,267,268],"dd",{},"critical",[261,270,272],{"id":271},"tier","Tier",[266,274,275],{},"error",[261,277,279],{"id":278},"category","Category",[266,281,282],{},"dead-code",[261,284,285],{"id":50},"Layer",[266,287,288],{},"container",[261,290,292],{"id":291},"version","Version",[266,294,295],{},"1",[261,297,299],{"id":298},"effort","Effort",[266,301,302,305],{},[27,303,304],{},"15min"," (about 15 minutes)",[261,307,308],{"id":56},"Reversibility",[266,310,311],{},"non-destructive",[59,313,315],{"id":314},"see-also","See also",[17,317,318,326,333],{},[20,319,320,325],{},[321,322,324],"a",{"href":323},"\u002Fcategories\u002Fdead-code\u002F","Dead-code rules"," — other rules in this category",[20,327,328,332],{},[321,329,331],{"href":330},"\u002Fhealth-score\u002F","Health score"," — how this rule contributes to the score",[20,334,335,339],{},[321,336,338],{"href":337},"\u002Frules\u002F","Rules catalog"," — browse all rules",[341,342,343],"style",{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":108,"searchDepth":122,"depth":122,"links":345},[346,347,348,349,350,351],{"id":61,"depth":122,"text":62},{"id":80,"depth":122,"text":81},{"id":93,"depth":122,"text":94},{"id":220,"depth":122,"text":221},{"id":252,"depth":122,"text":253},{"id":314,"depth":122,"text":315},[353,356,358],{"label":354,"href":355},"API Reference","\u002F",{"label":357,"href":337},"Rules",{"label":29},{"cards":360,"onpage":372},[361],{"title":362,"tabs":363},"Evaluate",[364,368],{"label":365,"language":366,"code":367},"cURL","bash","curl https:\u002F\u002Fdeveloper.tagmanifest.com\u002Fv1\u002Fevaluate-rule \\\n  -H \"Authorization: Bearer $TM_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"rule_id\":\"gat-get-trackers\",\"url\":\"https:\u002F\u002Fexample.com\"}'\n",{"label":369,"language":370,"code":371},"MCP","text","User: Run gat-get-trackers on https:\u002F\u002Fexample.com\n\n# Tool call\n{\n  \"tool\": \"evaluate_rule\",\n  \"arguments\": {\n    \"rule_id\": \"gat-get-trackers\",\n    \"url\": \"https:\u002F\u002Fexample.com\"\n  }\n}\n",[373,374,375,376,377],{"id":61,"label":62},{"id":80,"label":81},{"id":93,"label":94},{"id":220,"label":221},{"id":252,"label":253},null,"Tags use the _gat._getTrackers() method from the legacy ga.js library. This library is no longer loaded, so these calls fail silently.","md",{},true,"\u002Frules\u002Fgat-get-trackers","TechArticle",{"title":5,"description":379},"rules\u002Fgat-get-trackers",false,"FcB7BbyZmjRbrgCpgFFdxqspqpyqANXbfOES-qh29jA",1796069483455]