I have two google tag manager accounts one mine and another of third party website and I need to put these 2 in this third party website. I tried put two gtm scripts after body
Updated information:
According to Google official document (https://developers.google.com/tag-manager/devguide?hl=en#multiple-containers)
It suggests:
For more details and example refer to this official page link: https://developers.google.com/tag-manager/devguide?hl=en#multiple-containers
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.
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.
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