Jump to content

Prestashop 1.6 - problem with Google Tag Manager code


Recommended Posts

  • 3 weeks later...
  • 1 month later...

Hello, my  problem is the same with my GTM. But I dis all stemps and set code in to the header file under the <body>, but stil it's not working.

Please help.

 

You must place the GTM code in between the literal tags. 

<body>

{literal}        
  <!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXXX"
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-XXXXX');</script>
<!-- End Google Tag Manager -->
{/literal}
Edited by Zitty (see edit history)
  • Like 2
Link to comment
Share on other sites

Zitty, I know that and did it, but it not work for me. maybe you know why?

Untitled1.jpg

 

 

You have the performance settings enabled compilation and deactivated CACHE?

 

Try to view the source code in the browser.

 

EDIT:

 

Of course you have to edit the file header.tpl in currently used  the template.

 

sorry for bad English :)

Edited by Zitty (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 6 months later...
  • 8 months later...

I have inserted the GTM code with literal but the Analytics that I setup in the GTM doesn't seem to be firing correctly.

 

Tag assistant says that the Tag not fired through GTM & Code found outside of <head> tag.

 

{literal}
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXXXX"
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-XXXXXX');</script>
<!-- End Google Tag Manager -->
{/literal}

Also, how does a GTM code should look like when we view in under page source?

<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXXXX"

 

Hope some one can help.

 

Thanks.

Link to comment
Share on other sites

×
×
  • Create New...