[{"data":1,"prerenderedAt":440},["ShallowReactive",2],{"rule-ga4-debug-mode-hardcoded":3},{"id":4,"title":5,"body":6,"breadcrumb":403,"coderail":410,"dateModified":429,"datePublished":429,"description":430,"extension":431,"meta":432,"navigation":433,"next":429,"path":434,"prev":429,"schemaType":435,"seo":436,"stem":437,"wide":438,"__hash__":439},"docs\u002Frules\u002Fga4-debug-mode-hardcoded.md","debug_mode hardcoded to true",{"type":7,"value":8,"toc":395},"minimark",[9,16,61,66,94,98,111,115,257,261,301,305,363,367,391],[10,11,12],"p",{},[13,14,15],"strong",{},"Summary",[17,18,19,30,43,49,55],"ul",{},[20,21,22,25,26],"li",{},[13,23,24],{},"rule_id"," — ",[27,28,29],"code",{},"ga4-debug-mode-hardcoded",[20,31,32,35,36,39,40],{},[13,33,34],{},"purpose"," — Detect GA4 tags with ",[27,37,38],{},"debug_mode"," hardcoded to the literal string ",[27,41,42],{},"\"true\"",[20,44,45,48],{},[13,46,47],{},"effect"," — Events are excluded from standard GA4 reports and visible only in DebugView",[20,50,51,54],{},[13,52,53],{},"layer"," — container",[20,56,57,60],{},[13,58,59],{},"reversibility"," — non-destructive",[62,63,65],"h2",{"id":64},"what-fires-this","What fires this",[10,67,68,69,72,73,76,77,80,81,76,84,87,88,90,91,93],{},"The rule calls ",[27,70,71],{},"getGA4Tags()"," to collect all active GA4 Configuration and Event tags in the container. For each tag it merges ",[27,74,75],{},"ga4.eventParameters"," and ",[27,78,79],{},"ga4.configSettings"," into a single parameter list, then checks whether any entry has ",[27,82,83],{},"name === 'debug_mode'",[27,85,86],{},"value === 'true'",". The check is a strict string match against the literal value ",[27,89,42],{}," — a GTM variable reference does not trigger it. All matching tags are returned as a single issue, listed by tag ID and name. Paused tags are excluded by ",[27,92,71],{},".",[62,95,97],{"id":96},"why-it-matters","Why it matters",[10,99,100,101,103,104,107,108,110],{},"When ",[27,102,38],{}," is ",[27,105,106],{},"true",", GA4 routes events through DebugView instead of standard reporting. Those events do not appear in Explorations, standard reports, or conversions. Any tag left in this state in production silently drops data from your analytics. The parameter persists across every page where the tag fires. The fix is environmental: a GTM Lookup Table variable can return ",[27,109,42],{}," only in preview mode and omit the parameter entirely in production.",[62,112,114],{"id":113},"example","Before \u002F after",[116,117,118,201],"compare",{},[119,120,122],"compare-col",{"label":121},"Before — flagged",[123,124,129],"pre",{"className":125,"code":126,"language":127,"meta":128,"style":128},"language-json shiki shiki-themes github-light github-dark","{\n  \"parameter\": [\n    { \"type\": \"boolean\", \"key\": \"debug_mode\", \"value\": \"true\" }\n  ]\n}\n","json","",[27,130,131,140,150,189,195],{"__ignoreMap":128},[132,133,136],"span",{"class":134,"line":135},"line",1,[132,137,139],{"class":138},"sVt8B","{\n",[132,141,143,147],{"class":134,"line":142},2,[132,144,146],{"class":145},"sj4cs","  \"parameter\"",[132,148,149],{"class":138},": [\n",[132,151,153,156,159,162,166,169,172,174,177,179,182,184,186],{"class":134,"line":152},3,[132,154,155],{"class":138},"    { ",[132,157,158],{"class":145},"\"type\"",[132,160,161],{"class":138},": ",[132,163,165],{"class":164},"sZZnC","\"boolean\"",[132,167,168],{"class":138},", ",[132,170,171],{"class":145},"\"key\"",[132,173,161],{"class":138},[132,175,176],{"class":164},"\"debug_mode\"",[132,178,168],{"class":138},[132,180,181],{"class":145},"\"value\"",[132,183,161],{"class":138},[132,185,42],{"class":164},[132,187,188],{"class":138}," }\n",[132,190,192],{"class":134,"line":191},4,[132,193,194],{"class":138},"  ]\n",[132,196,198],{"class":134,"line":197},5,[132,199,200],{"class":138},"}\n",[119,202,204],{"label":203},"After — fixed",[123,205,207],{"className":125,"code":206,"language":127,"meta":128,"style":128},"{\n  \"parameter\": [\n    { \"type\": \"template\", \"key\": \"debug_mode\", \"value\": \"{{Debug Mode Variable}}\" }\n  ]\n}\n",[27,208,209,213,219,249,253],{"__ignoreMap":128},[132,210,211],{"class":134,"line":135},[132,212,139],{"class":138},[132,214,215,217],{"class":134,"line":142},[132,216,146],{"class":145},[132,218,149],{"class":138},[132,220,221,223,225,227,230,232,234,236,238,240,242,244,247],{"class":134,"line":152},[132,222,155],{"class":138},[132,224,158],{"class":145},[132,226,161],{"class":138},[132,228,229],{"class":164},"\"template\"",[132,231,168],{"class":138},[132,233,171],{"class":145},[132,235,161],{"class":138},[132,237,176],{"class":164},[132,239,168],{"class":138},[132,241,181],{"class":145},[132,243,161],{"class":138},[132,245,246],{"class":164},"\"{{Debug Mode Variable}}\"",[132,248,188],{"class":138},[132,250,251],{"class":134,"line":191},[132,252,194],{"class":138},[132,254,255],{"class":134,"line":197},[132,256,200],{"class":138},[62,258,260],{"id":259},"remediation","Remediation",[262,263,264,267,273,276,289,295,298],"ol",{},[20,265,266],{},"Open GTM and navigate to each flagged GA4 tag.",[20,268,269,270,272],{},"Locate the ",[27,271,38],{}," parameter in event parameters or configuration settings.",[20,274,275],{},"If debug mode was left over from testing, delete the parameter entirely.",[20,277,278,279,282,283,285,286,288],{},"If debug mode is needed for non-production environments, create a Lookup Table variable: map GTM's built-in ",[27,280,281],{},"{{Debug Mode}}"," value ",[27,284,106],{}," to the string ",[27,287,42],{},", and set the default value to blank (omits the parameter in production).",[20,290,291,292,294],{},"Replace the hardcoded ",[27,293,42],{}," with the new variable.",[20,296,297],{},"Preview the container to confirm DebugView activates in preview and standard reports receive events in production.",[20,299,300],{},"Publish the container.",[62,302,304],{"id":303},"metadata","Metadata",[306,307,310,311,316,310,320,324,310,327,331,310,334,337,310,340,344,310,347,351,310,357,360],"dl",{"className":308},[309],"spec-list","\n  ",[312,313,315],"dt",{"id":314},"severity","Severity",[317,318,319],"dd",{},"high",[312,321,323],{"id":322},"tier","Tier",[317,325,326],{},"optimization",[312,328,330],{"id":329},"category","Category",[317,332,333],{},"ga4",[312,335,336],{"id":53},"Layer",[317,338,339],{},"container",[312,341,343],{"id":342},"version","Version",[317,345,346],{},"1",[312,348,350],{"id":349},"effort","Effort",[317,352,353,356],{},[27,354,355],{},"15min"," (about 15 minutes)",[312,358,359],{"id":59},"Reversibility",[317,361,362],{},"non-destructive",[62,364,366],{"id":365},"see-also","See also",[17,368,369,377,384],{},[20,370,371,376],{},[372,373,375],"a",{"href":374},"\u002Fcategories\u002Fga4\u002F","GA4 rules"," — other rules in this category",[20,378,379,383],{},[372,380,382],{"href":381},"\u002Fhealth-score\u002F","Health score"," — how this rule contributes to the score",[20,385,386,390],{},[372,387,389],{"href":388},"\u002Frules\u002F","Rules catalog"," — browse all rules",[392,393,394],"style",{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}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":128,"searchDepth":142,"depth":142,"links":396},[397,398,399,400,401,402],{"id":64,"depth":142,"text":65},{"id":96,"depth":142,"text":97},{"id":113,"depth":142,"text":114},{"id":259,"depth":142,"text":260},{"id":303,"depth":142,"text":304},{"id":365,"depth":142,"text":366},[404,407,409],{"label":405,"href":406},"API Reference","\u002F",{"label":408,"href":388},"Rules",{"label":29},{"cards":411,"onpage":423},[412],{"title":413,"tabs":414},"Evaluate",[415,419],{"label":416,"language":417,"code":418},"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\":\"ga4-debug-mode-hardcoded\",\"url\":\"https:\u002F\u002Fexample.com\"}'\n",{"label":420,"language":421,"code":422},"MCP","text","User: Run ga4-debug-mode-hardcoded on https:\u002F\u002Fexample.com\n\n# Tool call\n{\n  \"tool\": \"evaluate_rule\",\n  \"arguments\": {\n    \"rule_id\": \"ga4-debug-mode-hardcoded\",\n    \"url\": \"https:\u002F\u002Fexample.com\"\n  }\n}\n",[424,425,426,427,428],{"id":64,"label":65},{"id":96,"label":97},{"id":113,"label":114},{"id":259,"label":260},{"id":303,"label":304},null,"debug_mode is set to literal \"true\" instead of a GTM variable, so it stays on in production.","md",{},true,"\u002Frules\u002Fga4-debug-mode-hardcoded","TechArticle",{"title":5,"description":430},"rules\u002Fga4-debug-mode-hardcoded",false,"E8YBFrvPed-ASSgjBo0EWFOiVXwjxhWQp_PhyBMcYhQ",1796069483621]