Pergunta

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 ?

Foi útil?

Solução 2

Sorry I can't be more specific about the resolution, I actually just cleaned GTM removing all the unused scripts and it worked !

Outras dicas

It seems that the GTM script will 404 until you add a tag. I couldn't find this documented anywhere either.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top