Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Google Tag Manager Script Rate Topic   - - - - -

 
  • philr
  • Junior Member
  • Members
  • Join Date: 19-Oct 10
  • 23 posts

Posted 08 March 2019 - 11:43 PM #1

I am having an issue trying to get a Google Tag Manager script into the <head> section of my web pages. I have inserted the code into the file:

 

/my_changes/hooks/index/scripts.post.tpl

 

As recommended in other posts but it does not show in the source code. I have tried both with and without {literal}. I have also tried to install it in the "default" layout in the custom HTML code box as also suggested but the code just disappears when I hit "save".

 

Any direction would be appreciated.

 

 



 
  • philr
  • Junior Member
  • Members
  • Join Date: 19-Oct 10
  • 23 posts

Posted 09 March 2019 - 07:42 PM #2

Just wanted to mention that I followed these instructions from another post and it shut down my site:

 

Hello! You can create a file [cscart_root]/design/themes/[your_theme]/templates/addons/my_changes/hooks/index/head_scripts.post.tpl in my_changes addon and put your code to it.

 

The code I am trying to add is:

 

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googleta...?id="></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', '');
</script>

 

 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19036 posts

Posted 11 March 2019 - 05:42 AM #3

You can try our free module

 

https://www.ecom-lab...ger-add-on.html


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.