Two different google tag manager accounts in same domain

≡放荡痞女 提交于 2019-12-03 11:11:25

This is because both GTM tags are using the default "dataLayer". See below:

<!-- Google Tag Manager -->
<noscript><iframe...
(window,document,'script','dataLayer','GTM-XXXX');</script>
<!-- End Google Tag Manager -->

Give one or both custom dataLayer names like so...(documentation):

<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script’,'gtm1dataLayer','GTM-XXXX');</script>
<!-- End Google Tag Manager -->

After that you should see no duplicate events firing from either container.

Peesen87

Google tells us that you should not use two tag managers on one site. Google Support:

Multiple installations of Google Tag Manager detected

We suggest you place only 1 instance of the GTM snippet on a webpage. Multiple GTM snippets don"t work well with each other
Multiple GTM snippets don"t work well with each other because of which the tag added via GTM may not always fire correctly.

Place only 1 instance of the GTM snippet on a webpage

https://support.google.com/tagassistant/answer/3207128?hl=en#multiple_tags

There should be no issues with multiple GTM containers on the same page. Unless you have duplicate codes in the containers which are double firing pixels. You can add those containers after the opening body tag.

To check what is firing on the entire page. Download firebug for firefox and add the "omnibug" extension. The omnibug extension should be in the firefox firebug window when you open it.

When you go the omnibug in the firefox panel, you will see EVERYTHING THAT IS FIRING!

If there are duplicate tags firing in the omnibug box, then you can check the details of the event and figure out which specific tag and delete them from the GTM container that you own.

Seems possible to find any answer you like for this. According to tag manager developer guide you can add multiple containers but you should use the same datalayer.

https://developers.google.com/tag-manager/devguide#multiple-containers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!