[{"data":1,"prerenderedAt":434},["ShallowReactive",2],{"rule-ecommerce-tool-custom-html":3},{"id":4,"title":5,"body":6,"breadcrumb":397,"coderail":405,"dateModified":424,"datePublished":424,"description":425,"extension":426,"meta":427,"navigation":173,"next":424,"path":428,"prev":424,"schemaType":429,"seo":430,"stem":431,"wide":432,"__hash__":433},"docs\u002Frules\u002Fecommerce-tool-custom-html.md","Ecommerce tools via Custom HTML",{"type":7,"value":8,"toc":389},"minimark",[9,16,54,59,78,82,85,89,274,278,296,300,358,362,385],[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",{},"ecommerce-tool-custom-html",[20,31,32,35],{},[13,33,34],{},"purpose"," — Detect ecommerce marketing platform integrations implemented via Custom HTML tags",[20,37,38,41],{},[13,39,40],{},"effect"," — Custom HTML implementations are harder to maintain, audit, and keep consent-compliant than native GTM templates or server-side alternatives",[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],{},"The rule iterates active, non-paused Custom HTML tags and tests each against the shared ",[27,63,64],{},"ECOMMERCE_TOOLS"," list. Detection uses two methods in sequence: parser-side ",[27,67,68],{},"codeAnalysis"," flags (e.g., ",[27,71,72],{},"codeAnalysis.hasKlaviyo",") and a regex pattern fallback on the raw tag code. The tool list covers Klaviyo, Segment, Braze, Iterable, mParticle, Omnisend, Drip, and Attentive. A tag matching either method is flagged. Consent gaps in the same tags are a separate finding handled by ",[27,75,76],{},"ecommerce-tool-consent",".",[55,79,81],{"id":80},"why-it-matters","Why it matters",[10,83,84],{},"Custom HTML implementations of marketing platforms are harder to maintain and audit than native templates or server-side integrations. When a vendor updates its API or initialization signature, a Custom HTML tag must be updated manually; a native GTM (Google Tag Manager) template typically receives updates from the template author. Custom HTML also provides no built-in consent hooks — the tag fires unconditionally unless a CMP (consent management platform) blocks it at the page level. Segment and Braze both have official GTM Community Template Gallery entries. Platforms without templates can be moved to server-side GTM for better data control.",[55,86,88],{"id":87},"example","Before \u002F after",[90,91,92,227],"compare",{},[93,94,96],"compare-col",{"label":95},"Before — flagged",[97,98,103],"pre",{"className":99,"code":100,"language":101,"meta":102,"style":102},"language-js shiki shiki-themes github-light github-dark","\u002F\u002F Custom HTML tag: \"Klaviyo — Init\"\nvar klaviyoScript = document.createElement('script')\nklaviyoScript.src = 'https:\u002F\u002Fstatic.klaviyo.com\u002Fonsite\u002Fjs\u002Fklaviyo.js?company_id=ABC123'\ndocument.head.appendChild(klaviyoScript)\n\nklaviyo.track('Viewed Product', {\n  ProductName: {{DLV - product_name}},\n  ProductID: {{DLV - product_id}}\n})\n","js","",[27,104,105,114,145,156,168,175,192,208,221],{"__ignoreMap":102},[106,107,110],"span",{"class":108,"line":109},"line",1,[106,111,113],{"class":112},"sJ8bj","\u002F\u002F Custom HTML tag: \"Klaviyo — Init\"\n",[106,115,117,121,125,128,131,135,138,142],{"class":108,"line":116},2,[106,118,120],{"class":119},"szBVR","var",[106,122,124],{"class":123},"sVt8B"," klaviyoScript ",[106,126,127],{"class":119},"=",[106,129,130],{"class":123}," document.",[106,132,134],{"class":133},"sScJk","createElement",[106,136,137],{"class":123},"(",[106,139,141],{"class":140},"sZZnC","'script'",[106,143,144],{"class":123},")\n",[106,146,148,151,153],{"class":108,"line":147},3,[106,149,150],{"class":123},"klaviyoScript.src ",[106,152,127],{"class":119},[106,154,155],{"class":140}," 'https:\u002F\u002Fstatic.klaviyo.com\u002Fonsite\u002Fjs\u002Fklaviyo.js?company_id=ABC123'\n",[106,157,159,162,165],{"class":108,"line":158},4,[106,160,161],{"class":123},"document.head.",[106,163,164],{"class":133},"appendChild",[106,166,167],{"class":123},"(klaviyoScript)\n",[106,169,171],{"class":108,"line":170},5,[106,172,174],{"emptyLinePlaceholder":173},true,"\n",[106,176,178,181,184,186,189],{"class":108,"line":177},6,[106,179,180],{"class":123},"klaviyo.",[106,182,183],{"class":133},"track",[106,185,137],{"class":123},[106,187,188],{"class":140},"'Viewed Product'",[106,190,191],{"class":123},", {\n",[106,193,195,198,202,205],{"class":108,"line":194},7,[106,196,197],{"class":123},"  ProductName: {{",[106,199,201],{"class":200},"sj4cs","DLV",[106,203,204],{"class":119}," -",[106,206,207],{"class":123}," product_name}},\n",[106,209,211,214,216,218],{"class":108,"line":210},8,[106,212,213],{"class":123},"  ProductID: {{",[106,215,201],{"class":200},[106,217,204],{"class":119},[106,219,220],{"class":123}," product_id}}\n",[106,222,224],{"class":108,"line":223},9,[106,225,226],{"class":123},"})\n",[93,228,230],{"label":229},"After — fixed",[97,231,233],{"className":99,"code":232,"language":101,"meta":102,"style":102},"\u002F\u002F Option A: Klaviyo tag via GTM Community Template Gallery\n\u002F\u002F Create tag → Community Templates → search \"Klaviyo\"\n\u002F\u002F Configure Company ID and event name in the template UI.\n\u002F\u002F No Custom HTML required.\n\n\u002F\u002F Option B: server-side GTM\n\u002F\u002F Route klaviyo.track() calls through an sGTM client tag.\n\u002F\u002F The client forwards events to Klaviyo's server-side API.\n",[27,234,235,240,245,250,255,259,264,269],{"__ignoreMap":102},[106,236,237],{"class":108,"line":109},[106,238,239],{"class":112},"\u002F\u002F Option A: Klaviyo tag via GTM Community Template Gallery\n",[106,241,242],{"class":108,"line":116},[106,243,244],{"class":112},"\u002F\u002F Create tag → Community Templates → search \"Klaviyo\"\n",[106,246,247],{"class":108,"line":147},[106,248,249],{"class":112},"\u002F\u002F Configure Company ID and event name in the template UI.\n",[106,251,252],{"class":108,"line":158},[106,253,254],{"class":112},"\u002F\u002F No Custom HTML required.\n",[106,256,257],{"class":108,"line":170},[106,258,174],{"emptyLinePlaceholder":173},[106,260,261],{"class":108,"line":177},[106,262,263],{"class":112},"\u002F\u002F Option B: server-side GTM\n",[106,265,266],{"class":108,"line":194},[106,267,268],{"class":112},"\u002F\u002F Route klaviyo.track() calls through an sGTM client tag.\n",[106,270,271],{"class":108,"line":210},[106,272,273],{"class":112},"\u002F\u002F The client forwards events to Klaviyo's server-side API.\n",[55,275,277],{"id":276},"remediation","Remediation",[279,280,281,284,287,290,293],"ol",{},[20,282,283],{},"Open the finding detail and note which tools are flagged and which tags implement them.",[20,285,286],{},"Search the GTM Community Template Gallery for a native template for each flagged tool.",[20,288,289],{},"For tools with an available template: create the native tag, mirror the configuration from the Custom HTML implementation, test in GTM Preview mode, then pause the Custom HTML tag.",[20,291,292],{},"For tools without a template (Klaviyo, Drip): document the implementation in the tag description, confirm explicit consent configuration is in place, and evaluate whether server-side GTM provides a better integration path.",[20,294,295],{},"After one reporting cycle confirms data continuity, delete the paused Custom HTML tags.",[55,297,299],{"id":298},"metadata","Metadata",[301,302,305,306,311,305,315,319,305,322,326,305,329,332,305,335,339,305,342,346,305,352,355],"dl",{"className":303},[304],"spec-list","\n  ",[307,308,310],"dt",{"id":309},"severity","Severity",[312,313,314],"dd",{},"medium",[307,316,318],{"id":317},"tier","Tier",[312,320,321],{},"optimization",[307,323,325],{"id":324},"category","Category",[312,327,328],{},"ecommerce",[307,330,331],{"id":46},"Layer",[312,333,334],{},"container",[307,336,338],{"id":337},"version","Version",[312,340,341],{},"1",[307,343,345],{"id":344},"effort","Effort",[312,347,348,351],{},[27,349,350],{},"2wk"," (about 2 weeks)",[307,353,354],{"id":52},"Reversibility",[312,356,357],{},"non-destructive",[55,359,361],{"id":360},"see-also","See also",[17,363,364,372,378],{},[20,365,366,371],{},[367,368,370],"a",{"href":369},"\u002Fcategories\u002Fecommerce\u002F","Ecommerce rules"," — other rules in this category",[20,373,374,377],{},[367,375,76],{"href":376},"\u002Frules\u002Fecommerce-tool-consent\u002F"," — consent gaps in the same platforms this rule detects",[20,379,380,384],{},[367,381,383],{"href":382},"\u002Fhealth-score\u002F","Health score"," — how this rule contributes to the score",[386,387,388],"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 .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}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":102,"searchDepth":116,"depth":116,"links":390},[391,392,393,394,395,396],{"id":57,"depth":116,"text":58},{"id":80,"depth":116,"text":81},{"id":87,"depth":116,"text":88},{"id":276,"depth":116,"text":277},{"id":298,"depth":116,"text":299},{"id":360,"depth":116,"text":361},[398,401,404],{"label":399,"href":400},"API Reference","\u002F",{"label":402,"href":403},"Rules","\u002Frules\u002F",{"label":29},{"cards":406,"onpage":418},[407],{"title":408,"tabs":409},"Evaluate",[410,414],{"label":411,"language":412,"code":413},"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\":\"ecommerce-tool-custom-html\",\"url\":\"https:\u002F\u002Fexample.com\"}'\n",{"label":415,"language":416,"code":417},"MCP","text","User: Run ecommerce-tool-custom-html on https:\u002F\u002Fexample.com\n\n# Tool call\n{\n  \"tool\": \"evaluate_rule\",\n  \"arguments\": {\n    \"rule_id\": \"ecommerce-tool-custom-html\",\n    \"url\": \"https:\u002F\u002Fexample.com\"\n  }\n}\n",[419,420,421,422,423],{"id":57,"label":58},{"id":80,"label":81},{"id":87,"label":88},{"id":276,"label":277},{"id":298,"label":299},null,"Custom HTML tags implement ecommerce marketing platform integrations (Klaviyo, Segment, Braze, Iterable, mParticle, Omnisend, Drip, Attentive). Custom HTML implementations are harder to maintain, debug, and audit than native GTM templates.","md",{},"\u002Frules\u002Fecommerce-tool-custom-html","TechArticle",{"title":5,"description":425},"rules\u002Fecommerce-tool-custom-html",false,"C2t_4DIKFCegY37ZOpZk80odjUZqlrtt5Tywpjjvqpw",1796069483582]