Project Description:
Hi,
I am trying to configure the new Google Tag manager on my site.
I am not sure if the problem lies with the code or with my setup.
Reason why I think it might be the code, I have had to place it within a PHP echo. I know the echo is loading at the right time but I am not sure if the code will still work after I had to add in / to let the ' work see below (changed my ID to XXXX for security):
echo '<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXX"
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-XXXX');</script>
<!-- End Google Tag Manager -->
';
The original code Google tag manager gave me was:
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-Q285"
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-Q285');</script>
<!-- End Google Tag Manager -->
Or it could be the setup on my Google Tag manager account, can give you access to this.
Thanks.
Additional Project Description:
10/05/2012 at 7:50 EDT
UPDATE: Looks like freelancer.com remove all my forward slashes, basically in my attempt to get it to work I added a forward slash before every apostrophe. Not sure if this was the right thing to do.