[{"data":1,"prerenderedAt":296},["ShallowReactive",2],{"rule-trigger-duplicate-custom-events":3},{"id":4,"title":5,"body":6,"breadcrumb":259,"coderail":266,"dateModified":285,"datePublished":285,"description":286,"extension":287,"meta":288,"navigation":289,"next":285,"path":290,"prev":285,"schemaType":291,"seo":292,"stem":293,"wide":294,"__hash__":295},"docs\u002Frules\u002Ftrigger-duplicate-custom-events.md","Duplicate custom event triggers",{"type":7,"value":8,"toc":249},"minimark",[9,16,54,59,70,74,77,81,128,132,159,163,221,225],[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-duplicate-custom-events",[20,31,32,35],{},[13,33,34],{},"purpose"," — Detect custom event triggers where 3 or more triggers listen for the same event name",[20,37,38,41],{},[13,39,40],{},"effect"," — Maintenance burden: any change to one trigger must be replicated across all copies",[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],{},"The rule iterates all triggers where ",[27,63,64],{},"type === 'CUSTOM_EVENT'"," and groups them by event name using the ",[27,67,68],{},"customEvent"," array on each trigger. If any event name appears in 3 or more triggers, the rule fires. Results are sorted by trigger count, highest first. The issue payload includes the event name, total trigger count, and trigger names (up to 5 per event). Triggers are not filtered by paused state — paused triggers contribute to the count.",[55,71,73],{"id":72},"why-it-matters","Why it matters",[10,75,76],{},"Each duplicate trigger is a separate object that must be updated independently. When firing conditions change — a new page type, a renamed event, a firing filter — every copy requires the same edit. Missed copies cause silent inconsistency: some tags fire, others do not. The more triggers share an event name, the higher the chance of drift after a container edit. Consolidating to a single trigger with filter conditions eliminates the replication requirement entirely.",[55,78,80],{"id":79},"example","Before \u002F after",[82,83,84,112],"compare",{},[85,86,88,95,109],"compare-col",{"label":87},"Before — flagged",[10,89,90,91,94],{},"Event name ",[27,92,93],{},"ce_form_submit"," is referenced by 4 separate triggers:",[17,96,97,100,103,106],{},[20,98,99],{},"\"CE - Form Submit (Contact)\"",[20,101,102],{},"\"CE - Form Submit (Demo)\"",[20,104,105],{},"\"CE - Form Submit (Newsletter)\"",[20,107,108],{},"\"CE - Form Submit (Webinar)\"",[10,110,111],{},"Each trigger has identical settings except for a page-path filter. All four require updates when the event name or firing window changes.",[85,113,115,118],{"label":114},"After — consolidated",[10,116,117],{},"One trigger: \"CE - Form Submit\"",[10,119,120,121,123,124,127],{},"Listens for ",[27,122,93],{},". Tags that need page-level targeting use a Trigger Exception or check ",[27,125,126],{},"{{Page Path}}"," via a Lookup Table variable. One trigger to maintain, one place to update.",[55,129,131],{"id":130},"remediation","Remediation",[133,134,135,138,141,144,147,150,153,156],"ol",{},[20,136,137],{},"Open the container and filter triggers by type \"Custom Event.\"",[20,139,140],{},"Sort by event name to surface groups with 3 or more triggers.",[20,142,143],{},"For each duplicate group, identify what distinguishes each trigger (page path, element, data layer condition).",[20,145,146],{},"Create one consolidated trigger for the event name.",[20,148,149],{},"Move distinguishing conditions into tag-level Trigger Exceptions or Lookup Table variables.",[20,151,152],{},"Re-assign all affected tags to the consolidated trigger.",[20,154,155],{},"Delete the redundant triggers and verify no tags reference the removed trigger IDs.",[20,157,158],{},"Test in GTM Preview that tags fire correctly with the consolidated trigger.",[55,160,162],{"id":161},"metadata","Metadata",[164,165,168,169,174,168,178,182,168,185,189,168,192,195,168,198,202,168,205,209,168,215,218],"dl",{"className":166},[167],"spec-list","\n  ",[170,171,173],"dt",{"id":172},"severity","Severity",[175,176,177],"dd",{},"medium",[170,179,181],{"id":180},"tier","Tier",[175,183,184],{},"info",[170,186,188],{"id":187},"category","Category",[175,190,191],{},"organization",[170,193,194],{"id":46},"Layer",[175,196,197],{},"container",[170,199,201],{"id":200},"version","Version",[175,203,204],{},"1",[170,206,208],{"id":207},"effort","Effort",[175,210,211,214],{},[27,212,213],{},"2hr"," (about 2 hours)",[170,216,217],{"id":52},"Reversibility",[175,219,220],{},"non-destructive",[55,222,224],{"id":223},"see-also","See also",[17,226,227,235,242],{},[20,228,229,234],{},[230,231,233],"a",{"href":232},"\u002Fcategories\u002Forganization\u002F","Organization rules"," — other rules in this category",[20,236,237,241],{},[230,238,240],{"href":239},"\u002Fhealth-score\u002F","Health score"," — how this rule contributes to the score",[20,243,244,248],{},[230,245,247],{"href":246},"\u002Frules\u002F","Rules catalog"," — browse all rules",{"title":250,"searchDepth":251,"depth":251,"links":252},"",2,[253,254,255,256,257,258],{"id":57,"depth":251,"text":58},{"id":72,"depth":251,"text":73},{"id":79,"depth":251,"text":80},{"id":130,"depth":251,"text":131},{"id":161,"depth":251,"text":162},{"id":223,"depth":251,"text":224},[260,263,265],{"label":261,"href":262},"API Reference","\u002F",{"label":264,"href":246},"Rules",{"label":29},{"cards":267,"onpage":279},[268],{"title":269,"tabs":270},"Evaluate",[271,275],{"label":272,"language":273,"code":274},"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-duplicate-custom-events\",\"url\":\"https:\u002F\u002Fexample.com\"}'\n",{"label":276,"language":277,"code":278},"MCP","text","User: Run trigger-duplicate-custom-events on https:\u002F\u002Fexample.com\n\n# Tool call\n{\n  \"tool\": \"evaluate_rule\",\n  \"arguments\": {\n    \"rule_id\": \"trigger-duplicate-custom-events\",\n    \"url\": \"https:\u002F\u002Fexample.com\"\n  }\n}\n",[280,281,282,283,284],{"id":57,"label":58},{"id":72,"label":73},{"id":79,"label":80},{"id":130,"label":131},{"id":161,"label":162},null,"3+ custom event triggers listening for the same event name. Multiple triggers for the same event create maintenance confusion — changes must be replicated across all copies.","md",{},true,"\u002Frules\u002Ftrigger-duplicate-custom-events","TechArticle",{"title":5,"description":286},"rules\u002Ftrigger-duplicate-custom-events",false,"HfYycp3KlFDkhd5wMH91ieojAN3ZGL2qveLYHJkegGs",1796069484110]