Two different google tag manager accounts in same domain

后端 未结 5 2128
故里飘歌
故里飘歌 2021-02-07 08:20

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

相关标签:
5条回答
  • 2021-02-07 08:38

    Updated information:

    According to Google official document (https://developers.google.com/tag-manager/devguide?hl=en#multiple-containers)

    It suggests:

    1. For the best performance of a page, keep the number of Google Tag Manager containers on the page minimal.
    2. If you use more than one container on a page, implement the container snippets with a common data layer object.
    3. Using more than one data layer can cause some triggers to stop working and could have other implications. So don't rename the data layer for a subset of containers on the page.
    4. You can, if necessary, rename the data layer for all containers on the page.
    5. Avoid implementing a Google Tag Manager container through a custom HTML tag in another Google Tag Manager container

    For more details and example refer to this official page link: https://developers.google.com/tag-manager/devguide?hl=en#multiple-containers

    0 讨论(0)
  • 2021-02-07 08:44

    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

    0 讨论(0)
  • 2021-02-07 08:47

    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.

    0 讨论(0)
  • 2021-02-07 08:53

    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.

    0 讨论(0)
  • 2021-02-07 08:54

    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

    0 讨论(0)
提交回复
热议问题