[{"data":1,"prerenderedAt":350},["ShallowReactive",2],{"rule-variable-no-type-prefix":3},{"id":4,"title":5,"body":6,"breadcrumb":314,"coderail":321,"dateModified":339,"datePublished":339,"description":340,"extension":341,"meta":342,"navigation":343,"next":339,"path":344,"prev":339,"schemaType":345,"seo":346,"stem":347,"wide":348,"__hash__":349},"docs\u002Frules\u002Fvariable-no-type-prefix.md","Variables without standard type prefixes",{"type":7,"value":8,"toc":305},"minimark",[9,16,54,59,103,107,122,126,158,162,215,219,277,281],[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",{},"variable-no-type-prefix",[20,31,32,35],{},[13,33,34],{},"purpose"," — Detect containers where too many user-created variables lack standard type prefixes",[20,37,38,41],{},[13,39,40],{},"effect"," — Variable type is opaque when referenced in tags and triggers; requires opening each variable to inspect",[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,73,77,73,80,73,83,73,86,73,89,73,92,73,95,98,99,102],{},"The rule filters out GTM built-in variables — names starting with ",[27,63,64],{},"gtm."," or type ",[27,67,68],{},"e"," — because users cannot rename them. For the remaining user-created variables, it tests each name against a prefix pattern covering ",[27,71,72],{},"DLV",", ",[27,75,76],{},"CJS",[27,78,79],{},"LUT",[27,81,82],{},"CONST",[27,84,85],{},"REGEX",[27,87,88],{},"URL",[27,90,91],{},"DOM",[27,93,94],{},"1PC",[27,96,97],{},"JS",", and ",[27,100,101],{},"K",", each followed by a separator (dash, en-dash, period, or space). The rule fires when 40% or more of user-created variables fail that test. Containers that are mostly well-prefixed but have a small legacy tail do not fire.",[55,104,106],{"id":105},"why-it-matters","Why it matters",[10,108,109,110,113,114,117,118,121],{},"When a tag references ",[27,111,112],{},"{{form_name}}",", a reviewer cannot tell whether it is a Data Layer Variable, Custom JavaScript, or a Lookup Table without opening the variable. Type prefixes communicate type at a glance: ",[27,115,116],{},"{{DLV - form_name}}"," is unambiguously a Data Layer Variable; ",[27,119,120],{},"{{CJS - form_name}}"," is Custom JavaScript. The convention reduces audit time, speeds up debugging, and lowers handoff friction for new developers working in the container.",[55,123,125],{"id":124},"example","Before \u002F after",[127,128,129,146],"compare",{},[130,131,133,136],"compare-col",{"label":132},"Before — flagged",[10,134,135],{},"Container has 18 user-created variables. 11 use bare descriptive names:",[137,138,143],"pre",{"className":139,"code":141,"language":142},[140],"language-text","form_name\npage_category\nuser_id\nemail\nproduct_sku\norder_total\nbutton_text\nreferrer_domain\nsession_id\nexperiment_variant\nga_client_id\n","text",[27,144,141],{"__ignoreMap":145},"",[130,147,149,152],{"label":148},"After — fixed",[10,150,151],{},"Same variables renamed with type prefixes:",[137,153,156],{"className":154,"code":155,"language":142},[140],"DLV - form_name\nDLV - page_category\nDLV - user_id\nDLV - email\nDLV - product_sku\nDLV - order_total\nDOM - button_text\nDLV - referrer_domain\n1PC - session_id\nDLV - experiment_variant\nCJS - ga_client_id\n",[27,157,155],{"__ignoreMap":145},[55,159,161],{"id":160},"remediation","Remediation",[163,164,165,195,198,209,212],"ol",{},[20,166,167,168,170,171,173,174,176,177,179,180,182,183,185,186,188,189,191,192,194],{},"Define the prefix convention for your container: ",[27,169,72],{}," (Data Layer Variable), ",[27,172,76],{}," (Custom JavaScript), ",[27,175,79],{}," (Lookup Table), ",[27,178,82],{}," (Constant), ",[27,181,94],{}," (First-Party Cookie), ",[27,184,88],{}," (URL variable), ",[27,187,91],{}," (DOM element), ",[27,190,85],{}," (Regex Table), ",[27,193,101],{}," (Google Tag key).",[20,196,197],{},"Open GTM and review the flagged variables returned in the rule output.",[20,199,200,201,204,205,208],{},"Rename each variable to include the appropriate prefix and a separator, for example ",[27,202,203],{},"form name"," → ",[27,206,207],{},"DLV - form_name",".",[20,210,211],{},"GTM updates all tag and trigger references automatically when you rename a variable in the UI — no manual find-replace is needed.",[20,213,214],{},"Publish the container after the renaming pass is complete.",[55,216,218],{"id":217},"metadata","Metadata",[220,221,224,225,230,224,234,238,224,241,245,224,248,251,224,254,258,224,261,265,224,271,274],"dl",{"className":222},[223],"spec-list","\n  ",[226,227,229],"dt",{"id":228},"severity","Severity",[231,232,233],"dd",{},"low",[226,235,237],{"id":236},"tier","Tier",[231,239,240],{},"info",[226,242,244],{"id":243},"category","Category",[231,246,247],{},"organization",[226,249,250],{"id":46},"Layer",[231,252,253],{},"container",[226,255,257],{"id":256},"version","Version",[231,259,260],{},"1",[226,262,264],{"id":263},"effort","Effort",[231,266,267,270],{},[27,268,269],{},"2hr"," (about 2 hours)",[226,272,273],{"id":52},"Reversibility",[231,275,276],{},"non-destructive",[55,278,280],{"id":279},"see-also","See also",[17,282,283,291,298],{},[20,284,285,290],{},[286,287,289],"a",{"href":288},"\u002Fcategories\u002Forganization\u002F","Organization rules"," — other rules in this category",[20,292,293,297],{},[286,294,296],{"href":295},"\u002Fhealth-score\u002F","Health score"," — how this rule contributes to the score",[20,299,300,304],{},[286,301,303],{"href":302},"\u002Frules\u002F","Rules catalog"," — browse all rules",{"title":145,"searchDepth":306,"depth":306,"links":307},2,[308,309,310,311,312,313],{"id":57,"depth":306,"text":58},{"id":105,"depth":306,"text":106},{"id":124,"depth":306,"text":125},{"id":160,"depth":306,"text":161},{"id":217,"depth":306,"text":218},{"id":279,"depth":306,"text":280},[315,318,320],{"label":316,"href":317},"API Reference","\u002F",{"label":319,"href":302},"Rules",{"label":29},{"cards":322,"onpage":333},[323],{"title":324,"tabs":325},"Evaluate",[326,330],{"label":327,"language":328,"code":329},"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\":\"variable-no-type-prefix\",\"url\":\"https:\u002F\u002Fexample.com\"}'\n",{"label":331,"language":142,"code":332},"MCP","User: Run variable-no-type-prefix on https:\u002F\u002Fexample.com\n\n# Tool call\n{\n  \"tool\": \"evaluate_rule\",\n  \"arguments\": {\n    \"rule_id\": \"variable-no-type-prefix\",\n    \"url\": \"https:\u002F\u002Fexample.com\"\n  }\n}\n",[334,335,336,337,338],{"id":57,"label":58},{"id":105,"label":106},{"id":124,"label":125},{"id":160,"label":161},{"id":217,"label":218},null,"40%+ of user-created variables lack standard type prefixes (DLV, CJS, LUT, CONST, etc.). Type prefixes make it immediately clear what kind of variable is being referenced.","md",{},true,"\u002Frules\u002Fvariable-no-type-prefix","TechArticle",{"title":5,"description":340},"rules\u002Fvariable-no-type-prefix",false,"C1hbVS6up7AEH43ZuB_TE4xx4qM2OsWWfrABdBlxe2g",1796069484116]