简体   繁体   中英

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.

They're all on a "truncated" url , the last part's missing. For example for mywebsite.com/lp/landing , I get a 404 error on mywebsite.com/lp (this route doesn't exist).

I also noticed those 404s are only thrown by IE8 (seeing the user agents).

When you go on this page with IE8 you don't see any error, though the server still throw this 404.

After few tests, I found out this is from some JS (disabling JS in IE8 didn't throw any 404). So I had to remove all my JS files, and finally found that the problem is from the Google Tag Manager script !

<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. I couldn't find this documented anywhere either.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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