{"id":89737,"date":"2025-02-15T13:18:14","date_gmt":"2025-02-15T13:18:14","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/gtmtips-use-an-all-events-trigger-for-more-control\/"},"modified":"2025-02-15T13:18:14","modified_gmt":"2025-02-15T13:18:14","slug":"gtmtips-use-an-all-events-trigger-for-more-control","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=89737","title":{"rendered":"#GTMTips: Use An All Events Trigger For More Control"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p>One of the most versatile <a href=\"https:\/\/www.simoahava.com\/analytics\/trigger-guide-google-tag-manager\/\">triggers<\/a> in <a href=\"https:\/\/tagmanager.google.com\/\">Google Tag Manager<\/a> is the <strong>Custom Event trigger<\/strong>. As its name indicates, you can use it to fire your tags when an <strong>event<\/strong> is pushed into <code>dataLayer<\/code>.<\/p>\n<p>This process is at the heart of GTM\u2019s <code>dataLayer<\/code> system. And it\u2019s not just <em>custom<\/em> events. Every single trigger type in Google Tag Manager uses the <code>event<\/code> key in a <code>dataLayer.push()<\/code>, which is why you\u2019ll see events like <code>gtm.click<\/code> (for the Click \/ All Elements trigger) and <code>gtm.timer<\/code> (for the Timer trigger) ending up in <code>dataLayer<\/code>, too.<\/p>\n<p>In this article, we\u2019ll explore a cool use case for the trigger I call an <strong>All Events<\/strong> trigger. An <strong>All Events<\/strong> trigger is a Custom Event trigger that\u2019s set to fire when <em>any<\/em> event is pushed into <code>dataLayer<\/code>.<\/p>\n<p>                <span class=\"simmer\"><br \/>\n  <span class=\"close\">X<\/span><\/p>\n<p>\n    <span class=\"fa fa-md fa-bell\"\/><br \/>\n    <strong>The Simmer Newsletter<\/strong>\n  <\/p>\n<p>\n    Subscribe to the <a href=\"https:\/\/www.simoahava.com\/newsletter\/\">Simmer newsletter<\/a> to get the latest news and content from Simo Ahava into your email inbox!\n  <\/p>\n<p>  <\/span><\/p>\n<h2 id=\"tip-114-use-an-all-events-trigger-to-constantly-check-for-something\">Tip 114: Use an All Events trigger to constantly check for something<\/h2>\n<div style=\"aspect-ratio: 960 \/ 540;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/05\/all-events-trigger.jpg\" title=\"All Events trigger\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"540\" width=\"960\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/05\/all-events-trigger.jpg#ZgotmplZ\" alt=\"All Events trigger\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Here\u2019s the trick.<\/p>\n<p>Let\u2019s say you want to fire your tag when a page element appears. You\u2019ve created a <a href=\"https:\/\/www.simoahava.com\/analytics\/variable-guide-google-tag-manager\/#9-dom-element\">DOM Element<\/a> variable, and you now want to fire a tag as soon as this element is present on the page.<\/p>\n<p>However, you have <strong>no clue<\/strong> when the element actually appears. It\u2019s not part of the page HTML but rather an asynchronously loading third-party library, for which you have no control over the render sequence. Furthermore, there\u2019s no guarantee the element is ever <strong>visible<\/strong> in the browser viewport, so an <a href=\"https:\/\/www.simoahava.com\/analytics\/element-visibility-trigger-google-tag-manager\/\">element visibility<\/a> doesn\u2019t help, either.<\/p>\n<p>So, what you need to do is create an <strong>All Events<\/strong> trigger that looks like this:<\/p>\n<div style=\"aspect-ratio: 1842 \/ 930;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/05\/all-events-dom.jpg\" title=\"All Events trigger\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"930\" width=\"1842\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/05\/all-events-dom.jpg#ZgotmplZ\" alt=\"All Events trigger\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>This trigger will activate with <em>every single trigger event<\/em> (that\u2019s what the regular expression <code>.*<\/code> does), but it will only fire if the DOM Element variable returns a valid value (i.e. it exists).<\/p>\n<p>We\u2019re still missing one thing. Can you think of what it is?<\/p>\n<p>That\u2019s right, you got it! (Or you just read what\u2019s in the hero image).<\/p>\n<p>If you don\u2019t make any modifications to the tag, it will fire for <em>every single trigger event<\/em> that\u2019s pushed after the DOM Element becomes available. We don\u2019t (likely) want that! So what you need to do in addition to adding the trigger to your tag, is to change the firing settings of the tag to <strong>Once per page<\/strong>:<\/p>\n<div style=\"aspect-ratio: 858 \/ 578;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2020\/05\/once-per-page.jpg\" title=\"Tag once per page\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"578\" width=\"858\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2020\/05\/once-per-page.jpg#ZgotmplZ\" alt=\"Tag once per page\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>That\u2019s it! Now your tag will fire once as soon as the DOM Element appears on the page.<\/p>\n<h2 id=\"summary\">Summary<\/h2>\n<p>Simple trick but a very powerful trigger. Obviously it would be best if you\u2019d cooperate with your developers to push an actual, predictable custom event into <code>dataLayer<\/code> as soon as the element becomes available. But if we lived in a perfect world I would have nothing to write about.<\/p>\n<p>Also, remember the caveats with \u201cOnce per page\u201d and single-page applications &#8211; \u201cOnce per page\u201d is literally \u201cOnce per page <strong>load<\/strong>\u201d, so with a SPA it would still fire just once, even if the user navigated to other pages of the site. In these scenarios you\u2019ll really need to get the developers to cooperate and build a proper event-driven mechanism into <code>dataLayer<\/code>.<\/p>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>One of the most versatile triggers in Google Tag Manager is the Custom Event trigger. As its name indicates, you can use it to fire your tags when an event is pushed into dataLayer. This process is at the heart of GTM\u2019s dataLayer system. And it\u2019s not just custom events. Every single trigger type in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":89738,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[2408,12573,14492,22089],"dealstore":[],"offerexpiration":[],"class_list":["post-89737","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-control","tag-events","tag-gtmtips","tag-trigger"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>#GTMTips: Use An All Events Trigger For More Control - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=89737\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"#GTMTips: Use An All Events Trigger For More Control - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"One of the most versatile triggers in Google Tag Manager is the Custom Event trigger. As its name indicates, you can use it to fire your tags when an event is pushed into dataLayer. This process is at the heart of GTM\u2019s dataLayer system. And it\u2019s not just custom events. Every single trigger type in [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=89737\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-15T13:18:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/all-events-trigger.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=89737#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=89737\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"#GTMTips: Use An All Events Trigger For More Control\",\"datePublished\":\"2025-02-15T13:18:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=89737\"},\"wordCount\":541,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=89737#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/all-events-trigger.jpg\",\"keywords\":[\"CONTROL\",\"EVENTS\",\"GTMTips\",\"Trigger\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=89737#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=89737\",\"url\":\"https:\/\/fivemor.com\/?p=89737\",\"name\":\"#GTMTips: Use An All Events Trigger For More Control - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=89737#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=89737#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/all-events-trigger.jpg\",\"datePublished\":\"2025-02-15T13:18:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=89737#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=89737\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=89737#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/all-events-trigger.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/all-events-trigger.jpg\",\"width\":960,\"height\":540},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=89737#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"#GTMTips: Use An All Events Trigger For More Control\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"#GTMTips: Use An All Events Trigger For More Control - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=89737","og_locale":"en_US","og_type":"article","og_title":"#GTMTips: Use An All Events Trigger For More Control - Som2ny Network","og_description":"One of the most versatile triggers in Google Tag Manager is the Custom Event trigger. As its name indicates, you can use it to fire your tags when an event is pushed into dataLayer. This process is at the heart of GTM\u2019s dataLayer system. And it\u2019s not just custom events. Every single trigger type in [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=89737","og_site_name":"Som2ny Network","article_published_time":"2025-02-15T13:18:14+00:00","og_image":[{"width":960,"height":540,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/all-events-trigger.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=89737#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=89737"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"#GTMTips: Use An All Events Trigger For More Control","datePublished":"2025-02-15T13:18:14+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=89737"},"wordCount":541,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=89737#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/all-events-trigger.jpg","keywords":["CONTROL","EVENTS","GTMTips","Trigger"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=89737#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=89737","url":"https:\/\/fivemor.com\/?p=89737","name":"#GTMTips: Use An All Events Trigger For More Control - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=89737#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=89737#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/all-events-trigger.jpg","datePublished":"2025-02-15T13:18:14+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=89737#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=89737"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=89737#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/all-events-trigger.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/02\/all-events-trigger.jpg","width":960,"height":540},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=89737#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"#GTMTips: Use An All Events Trigger For More Control"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/89737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=89737"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/89737\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/89738"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=89737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=89737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=89737"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=89737"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=89737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}