Cancelled

Trying to setup Google Tag Manager

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="//[url removed, login to view]"

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({\'[url removed, login to view]\':

new Date().getTime(),event:\'[url removed, login to view]\'});var f=[url removed, login to view](s)[0],

j=[url removed, login to view](s),dl=l!=\'dataLayer\'?\'&l=\'+l:\'\';j.async=true;j.src=

\'//[url removed, login to view]\'+i+dl;[url removed, login to view](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="//[url removed, login to view]"

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({'[url removed, login to view]':

new Date().getTime(),event:'[url removed, login to view]'});var f=[url removed, login to view](s)[0],

j=[url removed, login to view](s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=

'//[url removed, login to view]'+i+dl;[url removed, login to view](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.

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.

Skills: Javascript, PHP

See more: problem setup, loading function in php, id to code, google js, google tag, tag manager, ns#, javascript google tag, Event Manager, async, access manager, php google style, async javascript code, google tag manager javascript, trying, php tag, google javascript code, iframe style, google problem, tag code, add google account, access document manager, push google, push account, iframe hidden

About the Employer:
( 115 reviews ) Newark, United Kingdom

Project ID: #2540464

4 freelancers are bidding on average $88 for this job

zeke

You probably need backslash not forward slash (\ instead of /).

$30 USD in 0 days
(143 Reviews)
6.8
steven6

Hello, we are a group of programmers based in Sheffield, UK offering 7 years experience in php, .net, c#, jquery, css, python and c++. I am proposing to carry out tasks required for this project and deliver it within 2 More

$30 USD in 0 days
(24 Reviews)
5.5
misulica

Ready to start now

$40 USD in 1 day
(31 Reviews)
4.8
KRbq9UO32

Custom software development ([url removed, login to view] Administrator removed this message for containing contact details which breaches our Terms of Service)

$250 USD in 1 day
(0 Reviews)
0.0