{"id":136577,"date":"2025-03-16T04:21:43","date_gmt":"2025-03-16T04:21:43","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/gtmtips-multiple-gtm-containers-on-the-page\/"},"modified":"2025-03-16T04:21:43","modified_gmt":"2025-03-16T04:21:43","slug":"gtmtips-multiple-gtm-containers-on-the-page","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=136577","title":{"rendered":"#GTMTips: Multiple GTM Containers On The Page"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p>For some reason, you might run into a situation where you need to add multiple <a href=\"https:\/\/tagmanager.google.com\/\">Google Tag Manager<\/a> containers on the same page. Usually this is because of poor governance or an inflexible organization. My recommendation is to fix things in your projects first, and only resort to multiple containers if you can\u2019t seem to resolve your governance issues using your vocal cords (or your fists).<\/p>\n<p>Officially, Google Tag Manager introduced <a href=\"https:\/\/developers.google.com\/tag-manager\/devguide?hl=en#multiple-containers\">support for adding multiple containers<\/a> earlier in 2015. It\u2019s still not a recommended process, however, and rightfully so. Personally, I hope that development efforts in GTM would be directed towards making a single container more manageable by different parties, rather than adding support for hacks like this.<\/p>\n<p>In any case, this tip post is to remind you of how multiple containers can be implemented on a single page.<\/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-37-multiple-containers-use-the-same-datalayer\">Tip 37: Multiple containers use the same <code>dataLayer<\/code><\/h2>\n<div style=\"aspect-ratio: 960 \/ 540;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/12\/multiple-containers-same-page.jpg\" title=\"Multiple GTM containers on the same page\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"540\" width=\"960\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/12\/multiple-containers-same-page.jpg#ZgotmplZ\" alt=\"Multiple GTM containers on the same page\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>As you can see, the implementation is simple. Just add your containers as you would normally, but remember to <strong>use the same name for <code>dataLayer<\/code> across the container snippets<\/strong>. This is an important thing to note, because the unofficial recommendation before this support surfaced was to rename the <code>dataLayer<\/code> objects across the different containers.<\/p>\n<p>GTM takes care of the rest. Triggers should not have any conflicts, and even though the <strong>gtm.js<\/strong> event is pushed into <code>dataLayer<\/code> multiple times (by each container snippet), your All Pages and Page View Triggers should still just fire once per container.<\/p>\n<p>One place where potential conflicts can surface is with Data Layer Variables. When you push a key-value pair into <code>dataLayer<\/code>, it\u2019s registered just once, but each container will have access to this value, even if you pushed it \u201cfor one container\u201d only.<\/p>\n<p>This means that with stuff like <a href=\"https:\/\/www.simoahava.com\/analytics\/enhanced-ecommerce-tips-and-learnings\/\">Enhanced Ecommerce tracking<\/a> you might run into a situation where Tags in container B are inadvertently sending Ecommerce data, when you only intended Tags in container A to send them.<\/p>\n<p>The best way to mitigate this is to <a href=\"https:\/\/www.simoahava.com\/gtm-tips\/add-the-event-key-to-datalayer-pushes\/\">send an \u2018event\u2019 key<\/a> with each Enhanced Ecommerce push, and then <a href=\"https:\/\/www.simoahava.com\/gtm-tips\/remember-to-flush-unused-data-layer-variables\/\">purge the key from the data layer<\/a> after the Tag has fired. You can use <a href=\"https:\/\/www.simoahava.com\/gtm-tips\/hitcallback-eventcallback\/\">hitCallback or eventCallback<\/a> for that.<\/p>\n<p>Adding multiple containers is definitely not optimal, and there are many things to take into account, but it\u2019s doable if you devote some time to the implementation. Naturally, I would suggest you devote this time to making the organization work with just one container, but sometimes inflexibility takes precedence.<\/p>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>For some reason, you might run into a situation where you need to add multiple Google Tag Manager containers on the same page. Usually this is because of poor governance or an inflexible organization. My recommendation is to fix things in your projects first, and only resort to multiple containers if you can\u2019t seem to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":136578,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[10541,32680,14492,1025,4347],"dealstore":[],"offerexpiration":[],"class_list":["post-136577","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-containers","tag-gtm","tag-gtmtips","tag-multiple","tag-page"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>#GTMTips: Multiple GTM Containers On The Page - 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=136577\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"#GTMTips: Multiple GTM Containers On The Page - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"For some reason, you might run into a situation where you need to add multiple Google Tag Manager containers on the same page. Usually this is because of poor governance or an inflexible organization. My recommendation is to fix things in your projects first, and only resort to multiple containers if you can\u2019t seem to [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=136577\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-16T04:21:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/multiple-containers-same-page.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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=136577#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=136577\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"#GTMTips: Multiple GTM Containers On The Page\",\"datePublished\":\"2025-03-16T04:21:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=136577\"},\"wordCount\":439,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=136577#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/multiple-containers-same-page.jpg\",\"keywords\":[\"Containers\",\"GTM\",\"GTMTips\",\"Multiple\",\"Page\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=136577#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=136577\",\"url\":\"https:\/\/fivemor.com\/?p=136577\",\"name\":\"#GTMTips: Multiple GTM Containers On The Page - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=136577#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=136577#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/multiple-containers-same-page.jpg\",\"datePublished\":\"2025-03-16T04:21:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=136577#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=136577\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=136577#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/multiple-containers-same-page.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/multiple-containers-same-page.jpg\",\"width\":960,\"height\":540},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=136577#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"#GTMTips: Multiple GTM Containers On The Page\"}]},{\"@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: Multiple GTM Containers On The Page - 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=136577","og_locale":"en_US","og_type":"article","og_title":"#GTMTips: Multiple GTM Containers On The Page - Som2ny Network","og_description":"For some reason, you might run into a situation where you need to add multiple Google Tag Manager containers on the same page. Usually this is because of poor governance or an inflexible organization. My recommendation is to fix things in your projects first, and only resort to multiple containers if you can\u2019t seem to [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=136577","og_site_name":"Som2ny Network","article_published_time":"2025-03-16T04:21:43+00:00","og_image":[{"width":960,"height":540,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/multiple-containers-same-page.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=136577#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=136577"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"#GTMTips: Multiple GTM Containers On The Page","datePublished":"2025-03-16T04:21:43+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=136577"},"wordCount":439,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=136577#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/multiple-containers-same-page.jpg","keywords":["Containers","GTM","GTMTips","Multiple","Page"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=136577#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=136577","url":"https:\/\/fivemor.com\/?p=136577","name":"#GTMTips: Multiple GTM Containers On The Page - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=136577#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=136577#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/multiple-containers-same-page.jpg","datePublished":"2025-03-16T04:21:43+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=136577#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=136577"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=136577#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/multiple-containers-same-page.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/multiple-containers-same-page.jpg","width":960,"height":540},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=136577#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"#GTMTips: Multiple GTM Containers On The Page"}]},{"@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\/136577","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=136577"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/136577\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/136578"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=136577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=136577"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=136577"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=136577"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=136577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}