I am having some problems implementing Google Tag Manager on my website. I have a Google code, and when I try it on my site, it makes a lot of javascript conflicts.
So I tried to put the code on a seperate file, in order to do it Step by Step and observe the behavior of the different scripts.
So here my very simple HTML page:
<!DOCTYPE html>
<html>
<head>
<title>Titre</title>
</head>
<body>
<!-- Google Tag Manager -->
<noscript>
<iframe src="http://www.googletagmanager.com/ns.html?id=GTM-XXXXXX" height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
<script type="text/javascript">
dataLayer = [{'uid':'12'}];
(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-XXXXXX');
</script>
<!-- End Google Tag Manager -->
hello
</body>
</html>
And this very page, returns an error in the JS console:
Uncaught ReferenceError: jQuery is not defined
Well, this is unexpected, what does jQuery has to do here? I didn't even declare it on my body tag, is Google requiring jQuery?
So that was weird, and the second thing, when I look on my generated HTML page, after loading on a browser:
<body>
... Long stuff here
<script type="text/javascript" id="" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
... some other stuff here
</body>
What kind of sorcery is this? Why does Google add a jquery thing at the bottom of my page, and why does my console shows me a jQuery error?
Thanks a lot for any kind of information, I am totally lost... And have a nice day!
I finally found the solution, as it says in an other question, jQuery was injected by the googletagmanager and it was configured by the Web Agency that configured the google tag manager.
So if you have the same problem, call your Web Agency...
And if you have configured yourself the tag manager, check in your settings on Google Tag Manager interface.