[{"data":1,"prerenderedAt":443},["ShallowReactive",2],{"rule-replaceable-custom-html":3},{"id":4,"title":5,"body":6,"breadcrumb":407,"coderail":414,"dateModified":432,"datePublished":432,"description":433,"extension":434,"meta":435,"navigation":436,"next":432,"path":437,"prev":432,"schemaType":438,"seo":439,"stem":440,"wide":441,"__hash__":442},"docs\u002Frules\u002Freplaceable-custom-html.md","Custom HTML replaceable by native GTM template",{"type":7,"value":8,"toc":399},"minimark",[9,16,54,59,120,124,127,131,274,278,305,309,367,371,395],[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",{},"replaceable-custom-html",[20,31,32,35],{},[13,33,34],{},"purpose"," — Detect Custom HTML tags implementing functionality available as native GTM (Google Tag Manager) tag templates",[20,37,38,41],{},[13,39,40],{},"effect"," — Custom HTML tags bypass built-in consent enforcement and require manual updates when vendor APIs change",[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,93,94,97,98,101,102,105,106,109,110,85,113,116,117,119],{},"The rule iterates active Custom HTML tags and tests each tag's code against eleven platform-specific regex patterns. Matches are: Facebook\u002FMeta pixel init (",[27,63,64],{},"fbq('init'","), Facebook\u002FMeta event calls (",[27,67,68],{},"fbq('track'","), LinkedIn Insight Tag (",[27,71,72],{},"_linkedin_data_partner_id","), Google Ads conversion via ",[27,75,76],{},"gtag('event','conversion'","), Hotjar (",[27,79,80],{},"hotjar"," or ",[27,83,84],{},"hj("," with ",[27,87,88],{},"hjid"," also present), TikTok (",[27,91,92],{},"ttq.load","), Snapchat (",[27,95,96],{},"snaptr(","), Reddit (",[27,99,100],{},"rdt(","), Twitter\u002FX (",[27,103,104],{},"twq(","), Pinterest (",[27,107,108],{},"pintrk(","), and Microsoft Clarity (",[27,111,112],{},"clarity(",[27,114,115],{},"clarity.ms"," also present). Each matching tag is returned with a specific suggested replacement. Facebook event-only calls (",[27,118,68],{},") are flagged with a migration note: the init tag must move first. Paused tags are excluded.",[55,121,123],{"id":122},"why-it-matters","Why it matters",[10,125,126],{},"Native GTM templates — from Google or the Community Template Gallery — integrate with Consent Mode automatically. A Custom HTML tag carrying the same pixel does not. It fires regardless of consent state unless you add manual checks. Templates also receive vendor-pushed updates; a Custom HTML tag stays frozen at the API version the developer copied. When a vendor changes their snippet, the Custom HTML tag silently sends the wrong payload. Replacing with a native template removes both failure modes without data loss.",[55,128,130],{"id":129},"example","Before \u002F after",[132,133,134,263],"compare",{},[135,136,138],"compare-col",{"label":137},"Before — flagged",[139,140,145],"pre",{"className":141,"code":142,"language":143,"meta":144,"style":144},"language-js shiki shiki-themes github-light github-dark","\u002F\u002F Custom HTML tag: TikTok Pixel\n!function (w, d, t) {\n  w.TiktokAnalyticsObject=t;\n  var ttq=w[t]=w[t]||[];\n  ttq.load('AAABBBCCC111');\n  ttq.page();\n}(window, document, 'ttq');\n","js","",[27,146,147,156,185,197,221,241,252],{"__ignoreMap":144},[148,149,152],"span",{"class":150,"line":151},"line",1,[148,153,155],{"class":154},"sJ8bj","\u002F\u002F Custom HTML tag: TikTok Pixel\n",[148,157,159,163,167,171,174,177,179,182],{"class":150,"line":158},2,[148,160,162],{"class":161},"szBVR","!function",[148,164,166],{"class":165},"sVt8B"," (",[148,168,170],{"class":169},"s4XuR","w",[148,172,173],{"class":165},", ",[148,175,176],{"class":169},"d",[148,178,173],{"class":165},[148,180,181],{"class":169},"t",[148,183,184],{"class":165},") {\n",[148,186,188,191,194],{"class":150,"line":187},3,[148,189,190],{"class":165},"  w.TiktokAnalyticsObject",[148,192,193],{"class":161},"=",[148,195,196],{"class":165},"t;\n",[148,198,200,203,206,208,211,213,215,218],{"class":150,"line":199},4,[148,201,202],{"class":161},"  var",[148,204,205],{"class":165}," ttq",[148,207,193],{"class":161},[148,209,210],{"class":165},"w[t]",[148,212,193],{"class":161},[148,214,210],{"class":165},[148,216,217],{"class":161},"||",[148,219,220],{"class":165},"[];\n",[148,222,224,227,231,234,238],{"class":150,"line":223},5,[148,225,226],{"class":165},"  ttq.",[148,228,230],{"class":229},"sScJk","load",[148,232,233],{"class":165},"(",[148,235,237],{"class":236},"sZZnC","'AAABBBCCC111'",[148,239,240],{"class":165},");\n",[148,242,244,246,249],{"class":150,"line":243},6,[148,245,226],{"class":165},[148,247,248],{"class":229},"page",[148,250,251],{"class":165},"();\n",[148,253,255,258,261],{"class":150,"line":254},7,[148,256,257],{"class":165},"}(window, document, ",[148,259,260],{"class":236},"'ttq'",[148,262,240],{"class":165},[135,264,266],{"label":265},"After — native template",[139,267,272],{"className":268,"code":270,"language":271,"meta":144},[269],"language-text","Tag type: TikTok Pixel (Community Template Gallery)\nPixel ID: AAABBBCCC111\nTrigger: All Pages — Page View\nConsent settings: ad_storage (auto via Built-In Consent)\n","text",[27,273,270],{"__ignoreMap":144},[55,275,277],{"id":276},"remediation","Remediation",[279,280,281,284,287,290,293,296,299,302],"ol",{},[20,282,283],{},"Open each flagged tag and note the platform and the pixel or account ID in the code.",[20,285,286],{},"In GTM, go to Tags → New → Discover More Templates and search for the suggested template name.",[20,288,289],{},"Create a new native tag. Enter the same account ID or pixel ID from the Custom HTML tag.",[20,291,292],{},"Apply the same firing trigger the Custom HTML tag uses.",[20,294,295],{},"Verify consent settings on the native tag — most ad templates activate built-in consent automatically.",[20,297,298],{},"Run GTM Preview with both tags active. Confirm identical network requests to the vendor endpoint.",[20,300,301],{},"Pause the Custom HTML tag and publish the container.",[20,303,304],{},"After one reporting cycle confirms data continuity, delete the paused Custom HTML tag.",[55,306,308],{"id":307},"metadata","Metadata",[310,311,314,315,320,314,324,328,314,331,335,314,338,341,314,344,348,314,351,355,314,361,364],"dl",{"className":312},[313],"spec-list","\n  ",[316,317,319],"dt",{"id":318},"severity","Severity",[321,322,323],"dd",{},"medium",[316,325,327],{"id":326},"tier","Tier",[321,329,330],{},"optimization",[316,332,334],{"id":333},"category","Category",[321,336,337],{},"quality",[316,339,340],{"id":46},"Layer",[321,342,343],{},"container",[316,345,347],{"id":346},"version","Version",[321,349,350],{},"1",[316,352,354],{"id":353},"effort","Effort",[321,356,357,360],{},[27,358,359],{},"2hr"," (about 2 hours)",[316,362,363],{"id":52},"Reversibility",[321,365,366],{},"non-destructive",[55,368,370],{"id":369},"see-also","See also",[17,372,373,381,388],{},[20,374,375,380],{},[376,377,379],"a",{"href":378},"\u002Fcategories\u002Fquality\u002F","Quality rules"," — other rules in this category",[20,382,383,387],{},[376,384,386],{"href":385},"\u002Fhealth-score\u002F","Health score"," — how this rule contributes to the score",[20,389,390,394],{},[376,391,393],{"href":392},"\u002Frules\u002F","Rules catalog"," — browse all rules",[396,397,398],"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 .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}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":144,"searchDepth":158,"depth":158,"links":400},[401,402,403,404,405,406],{"id":57,"depth":158,"text":58},{"id":122,"depth":158,"text":123},{"id":129,"depth":158,"text":130},{"id":276,"depth":158,"text":277},{"id":307,"depth":158,"text":308},{"id":369,"depth":158,"text":370},[408,411,413],{"label":409,"href":410},"API Reference","\u002F",{"label":412,"href":392},"Rules",{"label":29},{"cards":415,"onpage":426},[416],{"title":417,"tabs":418},"Evaluate",[419,423],{"label":420,"language":421,"code":422},"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\":\"replaceable-custom-html\",\"url\":\"https:\u002F\u002Fexample.com\"}'\n",{"label":424,"language":271,"code":425},"MCP","User: Run replaceable-custom-html on https:\u002F\u002Fexample.com\n\n# Tool call\n{\n  \"tool\": \"evaluate_rule\",\n  \"arguments\": {\n    \"rule_id\": \"replaceable-custom-html\",\n    \"url\": \"https:\u002F\u002Fexample.com\"\n  }\n}\n",[427,428,429,430,431],{"id":57,"label":58},{"id":122,"label":123},{"id":129,"label":130},{"id":276,"label":277},{"id":307,"label":308},null,"Custom HTML implementations exist for platforms that have native GTM tag templates available.","md",{},true,"\u002Frules\u002Freplaceable-custom-html","TechArticle",{"title":5,"description":433},"rules\u002Freplaceable-custom-html",false,"-viPRjaRu_XS4T3UixC1X9u88Pfn_HAh6u5l0NyCkYc",1796069484290]