Google analytics Google标记管理器冲突,因为在我的HTML中有一个名为“的元素”;ga";和id=";ga";?

Google analytics Google标记管理器冲突,因为在我的HTML中有一个名为“的元素”;ga";和id=";ga";?,google-analytics,google-tag-manager,Google Analytics,Google Tag Manager,我的GTM代码是否可能因为与Google Analytics的冲突以及与的HTML元素而失败 我的Google Analytics标签是: <style>.async-hide { opacity: 0 !important} </style> <script>(function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date; h.end=i=function(){s.className=s.

我的GTM代码是否可能因为与Google Analytics的冲突以及与
的HTML元素而失败

我的Google Analytics标签是:

<style>.async-hide { opacity: 0 !important} </style>
<script>(function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date;
h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')};
(a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c;
})(window,document.documentElement,'async-hide','dataLayer',4000,
{'GTM-XXXXXXXXXXXXX':true});</script>
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-XXXXXXXXXXXX', 'auto');
  ga('send', 'pageview');

</script>
.async hide{opacity:0!重要}
(函数(a,s,y,n,c,h,i,d,e){s.className+=''+y;h.start=1*新日期;
h、 end=i=function(){s.className=s.className.replace(RegExp('?'+y),'');
(a[n]=a[n]| |[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c;
})(窗口,document.documentElement,'async-hide','dataLayer',4000,
{'GTM-XXXXXXXXXXXX':true});
(函数(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]| |函数(){
(i[r].q=i[r].q | |[]).push(参数)},i[r].l=1*新日期();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(窗口、文档、“脚本”和https://www.google-analytics.com/analytics.js","ga",;
ga(“创建”、“UA-XXXXXXXXXX”、“自动”);
ga(‘发送’、‘页面浏览’);
我是否应该将
'ga'
更改为其他内容,这样它仍然可以工作,但没有冲突

我找到了这个答案,但我不确定是否是同一个问题,但我会尝试去做(我不尝试自己测试的原因是,在营销团队能够检查之前,这将花费很多时间)


是的,这肯定是一个原因

它将生成的错误是:

Uncaught TypeError: ga is not a function

您可以从中看到这一点(请参阅控制台中的错误)。

是的,这肯定是一个原因

它将生成的错误是:

Uncaught TypeError: ga is not a function

您可以在这里看到它(请参阅控制台中的错误)。

正如Michele Pisani的回答所说,它确实存在冲突,并且可以通过此回答解决(更改全局函数名):


正如Michele Pisani的回答所说,它确实存在冲突,可以用这个答案来解决(更改全局函数名):