本文介绍了同一域中的两个不同的Google跟踪代码管理器帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个Google跟踪代码管理器帐户,一个是我的,另一个是第三方网站,我需要将这两个放在第三方网站中.我尝试在正文标签打开后放置两个gtm脚本,但看到两个帐户的内容重复.

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 tag opening but I saw duplicated content of both accounts.

我该怎么做?有可能吗?

How can I do this? It's possible?

推荐答案

这是因为两个GTM标签都使用默认的"dataLayer".见下文:

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.

这篇关于同一域中的两个不同的Google跟踪代码管理器帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 02:11