[{"data":1,"prerenderedAt":402},["ShallowReactive",2],{"rule-trigger-broad-regex":3},{"id":4,"title":5,"body":6,"breadcrumb":365,"coderail":372,"dateModified":391,"datePublished":391,"description":392,"extension":393,"meta":394,"navigation":395,"next":391,"path":396,"prev":391,"schemaType":397,"seo":398,"stem":399,"wide":400,"__hash__":401},"docs\u002Frules\u002Ftrigger-broad-regex.md","Trigger with overly broad regex pattern",{"type":7,"value":8,"toc":357},"minimark",[9,16,54,59,107,111,117,121,238,242,263,267,325,329,353],[10,11,12],"p",{},[13,14,15],"strong",{},"Summary",[17,18,19,30,36,42,48],"ul",{},[20,21,22,25,26],"li",{},[13,23,24],{},"rule_id"," — ",[27,28,29],"code",{},"trigger-broad-regex",[20,31,32,35],{},[13,33,34],{},"purpose"," — Detect MATCH_REGEX trigger filters whose pattern matches every string",[20,37,38,41],{},[13,39,40],{},"effect"," — Filter provides no selectivity; the trigger fires as broadly as if no filter existed",[20,43,44,47],{},[13,45,46],{},"layer"," — container",[20,49,50,53],{},[13,51,52],{},"reversibility"," — non-destructive",[55,56,58],"h2",{"id":57},"what-fires-this","What fires this",[10,60,61,62,65,66,69,70,73,74,77,78,81,82,85,86,89,90,89,93,96,97,100,101,103,104,106],{},"The rule iterates every trigger's ",[27,63,64],{},"filter"," array and checks each entry whose ",[27,67,68],{},"type"," is ",[27,71,72],{},"MATCH_REGEX"," (GTM JSON export format) or ",[27,75,76],{},"_re"," (raw ",[27,79,80],{},"gtm.js"," scan format). Both representations are accepted. A filter is flagged when its ",[27,83,84],{},"arg1"," value trims to ",[27,87,88],{},".*",", ",[27,91,92],{},".+",[27,94,95],{},"^.*$",", or ",[27,98,99],{},"^.+$",", or when the pattern starts with ",[27,102,88],{}," and also ends with ",[27,105,88],{},". Each unique trigger ID is deduplicated before reporting, so one issue is raised per trigger regardless of how many broad filters it contains.",[55,108,110],{"id":109},"why-it-matters","Why it matters",[10,112,113,114,116],{},"A MATCH_REGEX filter is meant to restrict which values activate a trigger. A pattern like ",[27,115,88],{}," matches every non-null string, so the filter does nothing. The trigger fires on every qualifying event, identical to having no filter at all. This wastes processing cycles on every GTM evaluation and often signals a filter left in a default or placeholder state. Conditions intended to limit firing — such as matching only a specific page path or event name — need a concrete pattern, not a catch-all.",[55,118,120],{"id":119},"example","Before \u002F after",[122,123,124,193],"compare",{},[125,126,128],"compare-col",{"label":127},"Before — flagged",[129,130,135],"pre",{"className":131,"code":132,"language":133,"meta":134,"style":134},"language-json shiki shiki-themes github-light github-dark","{\n  \"type\": \"MATCH_REGEX\",\n  \"arg0\": \"{{Page Path}}\",\n  \"arg1\": \".*\"\n}\n","json","",[27,136,137,146,163,176,187],{"__ignoreMap":134},[138,139,142],"span",{"class":140,"line":141},"line",1,[138,143,145],{"class":144},"sVt8B","{\n",[138,147,149,153,156,160],{"class":140,"line":148},2,[138,150,152],{"class":151},"sj4cs","  \"type\"",[138,154,155],{"class":144},": ",[138,157,159],{"class":158},"sZZnC","\"MATCH_REGEX\"",[138,161,162],{"class":144},",\n",[138,164,166,169,171,174],{"class":140,"line":165},3,[138,167,168],{"class":151},"  \"arg0\"",[138,170,155],{"class":144},[138,172,173],{"class":158},"\"{{Page Path}}\"",[138,175,162],{"class":144},[138,177,179,182,184],{"class":140,"line":178},4,[138,180,181],{"class":151},"  \"arg1\"",[138,183,155],{"class":144},[138,185,186],{"class":158},"\".*\"\n",[138,188,190],{"class":140,"line":189},5,[138,191,192],{"class":144},"}\n",[125,194,196],{"label":195},"After — fixed",[129,197,199],{"className":131,"code":198,"language":133,"meta":134,"style":134},"{\n  \"type\": \"MATCH_REGEX\",\n  \"arg0\": \"{{Page Path}}\",\n  \"arg1\": \"^\u002Fblog\u002F\"\n}\n",[27,200,201,205,215,225,234],{"__ignoreMap":134},[138,202,203],{"class":140,"line":141},[138,204,145],{"class":144},[138,206,207,209,211,213],{"class":140,"line":148},[138,208,152],{"class":151},[138,210,155],{"class":144},[138,212,159],{"class":158},[138,214,162],{"class":144},[138,216,217,219,221,223],{"class":140,"line":165},[138,218,168],{"class":151},[138,220,155],{"class":144},[138,222,173],{"class":158},[138,224,162],{"class":144},[138,226,227,229,231],{"class":140,"line":178},[138,228,181],{"class":151},[138,230,155],{"class":144},[138,232,233],{"class":158},"\"^\u002Fblog\u002F\"\n",[138,235,236],{"class":140,"line":189},[138,237,192],{"class":144},[55,239,241],{"id":240},"remediation","Remediation",[243,244,245,248,251,254,257,260],"ol",{},[20,246,247],{},"Open the flagged trigger in GTM and locate the MATCH_REGEX filter condition.",[20,249,250],{},"Determine what value the filter was intended to restrict — page path, event name, URL, or another variable.",[20,252,253],{},"Replace the broad pattern with a specific regex that matches only the intended values.",[20,255,256],{},"If no filtering is needed, remove the filter condition entirely rather than leaving a pass-through pattern.",[20,258,259],{},"Save and preview the trigger to confirm it fires only on the expected events.",[20,261,262],{},"Publish the container once the corrected trigger is verified.",[55,264,266],{"id":265},"metadata","Metadata",[268,269,272,273,278,272,282,286,272,289,293,272,296,299,272,302,306,272,309,313,272,319,322],"dl",{"className":270},[271],"spec-list","\n  ",[274,275,277],"dt",{"id":276},"severity","Severity",[279,280,281],"dd",{},"medium",[274,283,285],{"id":284},"tier","Tier",[279,287,288],{},"optimization",[274,290,292],{"id":291},"category","Category",[279,294,295],{},"quality",[274,297,298],{"id":46},"Layer",[279,300,301],{},"container",[274,303,305],{"id":304},"version","Version",[279,307,308],{},"1",[274,310,312],{"id":311},"effort","Effort",[279,314,315,318],{},[27,316,317],{},"15min"," (about 15 minutes)",[274,320,321],{"id":52},"Reversibility",[279,323,324],{},"non-destructive",[55,326,328],{"id":327},"see-also","See also",[17,330,331,339,346],{},[20,332,333,338],{},[334,335,337],"a",{"href":336},"\u002Fcategories\u002Fquality\u002F","Quality rules"," — other rules in this category",[20,340,341,345],{},[334,342,344],{"href":343},"\u002Fhealth-score\u002F","Health score"," — how this rule contributes to the score",[20,347,348,352],{},[334,349,351],{"href":350},"\u002Frules\u002F","Rules catalog"," — browse all rules",[354,355,356],"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":134,"searchDepth":148,"depth":148,"links":358},[359,360,361,362,363,364],{"id":57,"depth":148,"text":58},{"id":109,"depth":148,"text":110},{"id":119,"depth":148,"text":120},{"id":240,"depth":148,"text":241},{"id":265,"depth":148,"text":266},{"id":327,"depth":148,"text":328},[366,369,371],{"label":367,"href":368},"API Reference","\u002F",{"label":370,"href":350},"Rules",{"label":29},{"cards":373,"onpage":385},[374],{"title":375,"tabs":376},"Evaluate",[377,381],{"label":378,"language":379,"code":380},"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\":\"trigger-broad-regex\",\"url\":\"https:\u002F\u002Fexample.com\"}'\n",{"label":382,"language":383,"code":384},"MCP","text","User: Run trigger-broad-regex on https:\u002F\u002Fexample.com\n\n# Tool call\n{\n  \"tool\": \"evaluate_rule\",\n  \"arguments\": {\n    \"rule_id\": \"trigger-broad-regex\",\n    \"url\": \"https:\u002F\u002Fexample.com\"\n  }\n}\n",[386,387,388,389,390],{"id":57,"label":58},{"id":109,"label":110},{"id":119,"label":120},{"id":240,"label":241},{"id":265,"label":266},null,"Regex filters use patterns like \".*\" or \".+\" that match everything, providing no actual filtering.","md",{},true,"\u002Frules\u002Ftrigger-broad-regex","TechArticle",{"title":5,"description":392},"rules\u002Ftrigger-broad-regex",false,"llDojNTYaoeE6vdT2Rh1tMMONtjUak6vCsbepcA1kn0",1796069484360]