简体   繁体   English

Google跟踪代码管理器+ IE8生成404

[英]Google Tag Manager + IE8 generating 404s

Because I use a tool sending an email everytime a 404 page is thrown, I noticed I've got lots of weird ones. 因为我使用了每次抛出404页时都会发送电子邮件的工具,所以我注意到我有很多奇怪的东西。

They're all on a "truncated" url , the last part's missing. 它们都在“截断的” URL上 ,最后一部分丢失了。 For example for mywebsite.com/lp/landing , I get a 404 error on mywebsite.com/lp (this route doesn't exist). 例如,对于mywebsite.com/lp/landing ,我在mywebsite.com/lp上收到404错误(此路由不存在)。

I also noticed those 404s are only thrown by IE8 (seeing the user agents). 我还注意到那些404仅由IE8抛出(请参阅用户代理)。

When you go on this page with IE8 you don't see any error, though the server still throw this 404. 当您使用IE8进入此页面时,尽管服务器仍然抛出此404,但您看不到任何错误。

After few tests, I found out this is from some JS (disabling JS in IE8 didn't throw any 404). 经过几次测试,我发现这是来自某些JS(在IE8中禁用JS不会抛出任何404)。 So I had to remove all my JS files, and finally found that the problem is from the Google Tag Manager script ! 因此,我不得不删除所有JS文件,最后发现问题出在Google跟踪代码管理器脚本中

<noscript><iframe src='//www.googletagmanager.com/ns.html?id=GTM-Q36B'
            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','dataLayer','GTM-Q36B');</script>

I don't find anything about this issue, any idea how to fix it ? 我没有找到关于此问题的任何信息,知道如何解决它吗?

It seems that the GTM script will 404 until you add a tag. 在添加标签之前,GTM脚本似乎会显示404。 I couldn't find this documented anywhere either. 我也找不到任何地方记录的文档。

抱歉,我无法更详细地了解分辨率,实际上我只是清理了GTM并删除了所有未使用的脚本,它正常工作!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM