Pvv Posted March 27, 2017 Share Posted March 27, 2017 Hello. I am trying to add a google tag manager code to my prestashop 1.7 installation and all the instructions are saying that i should edit the header.tpl file in head and body. but the header.tpl file does not have any head and body parts of code, only a lot of divs. Has anyone had any experience with this? Link to comment Share on other sites More sharing options...
Pvv Posted April 3, 2017 Author Share Posted April 3, 2017 No one? :/ Link to comment Share on other sites More sharing options...
HanzCZ Posted April 4, 2017 Share Posted April 4, 2017 Try to find "<body" or "<head" in all files of your FTP (I use AstroGrep for this). I have no experiences with ps 1.7. Body and head tags are located in header.tpl in PS 1.6 Link to comment Share on other sites More sharing options...
Pvv Posted April 10, 2017 Author Share Posted April 10, 2017 in 1.7 prestashop the tpl files do not contain <body or <head ... :/ 1 Link to comment Share on other sites More sharing options...
Web Curator Posted May 25, 2017 Share Posted May 25, 2017 No one with an idea? I can't believe that we are forced to buy a module 1 Link to comment Share on other sites More sharing options...
DataKick Posted May 25, 2017 Share Posted May 25, 2017 (edited) you really dont No one with an idea? I can't believe that we are forced to buy a module you really don't Simply paste your script to themes/classic/templates/_partials/head.tpl. Don't forget to include <script> tag. And clear cache after you edit the template file. Example: {block name='javascript_head'} {include file="_partials/javascript.tpl" javascript=$javascript.head vars=$js_custom_vars} {/block} <script type="text/javascript"> // your google tag manager init script goes here </script> {block name='hook_header'} {$HOOK_HEADER nofilter} {/block} Edited May 25, 2017 by DataKick (see edit history) 2 1 Link to comment Share on other sites More sharing options...
Web Curator Posted May 29, 2017 Share Posted May 29, 2017 (edited) you really dont you really don't Simply paste your script to themes/classic/templates/_partials/head.tpl. Don't forget to include <script> tag. And clear cache after you edit the template file. Example: {block name='javascript_head'} {include file="_partials/javascript.tpl" javascript=$javascript.head vars=$js_custom_vars} {/block} <script type="text/javascript"> // your google tag manager init script goes here </script> {block name='hook_header'} {$HOOK_HEADER nofilter} {/block} Dear DataKick, Thanks for your reply, the google tag manager needs to put two scripts: 1) in section HEAD 1) in section BODY Have you any info where is bettere to put the part dedicated for the body Thanks and Regard Edited May 29, 2017 by Web Curator (see edit history) Link to comment Share on other sites More sharing options...
DataKick Posted May 29, 2017 Share Posted May 29, 2017 Dear DataKick, Thanks for your reply, the google tag manager needs to put two scripts: 1) in section HEAD 1) in section BODY Have you any info where is bettere to put the part dedicated for the body Thanks and Regard you could try to add this to themes/classic/templates/_partials/header.tpl Alternatively, you can add both scripts to layout file - themes/classic/templates/layouts/layout-both-columns.tpl (or whatever layout/theme you are using) 1 Link to comment Share on other sites More sharing options...
Web Curator Posted May 29, 2017 Share Posted May 29, 2017 I'm using the classic theme of 1.7 customized by me. I will try and come back to you as soon as possible, Thank for your time Link to comment Share on other sites More sharing options...
Web Curator Posted June 6, 2017 Share Posted June 6, 2017 I suggest to make this steps: 1) REMOVE THE COMMENTS <!-- Google Tag Manager --> <!-- End Google Tag Manager --> 2) open a tag {literal} and close it at the end of each snipplet {/literal} {literal} <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=XXXXXXX" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> {/literal} 3) Insert in: head.tpl (and not header.tpl) one part and the other in layout-both-columns.tpl 4) Check if everything is fine via the Chrome Add-on Google-Tag-Assistent 3 2 Link to comment Share on other sites More sharing options...
clement_bobbies Posted August 31, 2017 Share Posted August 31, 2017 I suggest to make this steps: 1) REMOVE THE COMMENTS <!-- Google Tag Manager --> <!-- End Google Tag Manager --> 2) open a tag {literal} and close it at the end of each snipplet {/literal} {literal} <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=XXXXXXX" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> {/literal} 3) Insert in: head.tpl (and not header.tpl) one part and the other in layout-both-columns.tpl 4) Check if everything is fine via the Chrome Add-on Google-Tag-Assistent To include the two .js you can create a custom module that implement two hooks : displayHeader (to add js in header) displayAfterBodyOpeningTag (to add js in body) Then : You should create two templates files(.tpl) : 1 per js for each tpl, copy/paste the GTM js code following step 1 and step 2 above In your module configuration file, you just have to implement the two hooks by returning the two tpl : return $this->fetch(YOUR_TPL_PATH); Link to comment Share on other sites More sharing options...
mellsaid Posted August 30, 2018 Share Posted August 30, 2018 Did anyone get somewhere with this? We keep getting: An error occured while the tag was fired: net::ERR_ABORTED Error while sending request: net::ERR_ABORTED Link to comment Share on other sites More sharing options...
Knowband Plugins Posted August 31, 2018 Share Posted August 31, 2018 Did you check the same in other browser & system? Search the NET ABORTED Google Tag manager issue in the Google & you can find many help link to diagnose the same like http://mixedanalytics.com/blog/tag-assistant-error-occurred-while-tag-fired/ Link to comment Share on other sites More sharing options...
mellsaid Posted August 31, 2018 Share Posted August 31, 2018 2 minutes ago, Knowband Plugins said: Did you check the same in other browser & system? Search the NET ABORTED Google Tag manager issue in the Google & you can find many help link to diagnose the same like http://mixedanalytics.com/blog/tag-assistant-error-occurred-while-tag-fired/ Some people said its not an error to worry about as its just different order of triggers. So We have fixed it by just adding a tag in the tag manager and publishing it and the it all worked fine - if its helpful for anyone! Link to comment Share on other sites More sharing options...
awbo Posted December 11, 2018 Share Posted December 11, 2018 the new version 1.7.4.4 is different. in the latest version this method does not work, any suggestions? Regards 1 Link to comment Share on other sites More sharing options...
RikMK Posted March 29 Share Posted March 29 On 6/6/2017 at 3:06 PM, Web Curator said: I suggest to make this steps: 1) REMOVE THE COMMENTS <!-- Google Tag Manager --> <!-- End Google Tag Manager --> 2) open a tag {literal} and close it at the end of each snipplet {/literal} {literal} <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=XXXXXXX" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> {/literal} 3) Insert in: head.tpl (and not header.tpl) one part and the other in layout-both-columns.tpl 4) Check if everything is fine via the Chrome Add-on Google-Tag-Assistent Confirmed working still in Prestashop 8.1.4 for anyone landing here. No need for modules to include GTM script (although the suggestion after above comment is valid) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now