Popular Post Himanshubishtt Posted May 12, 2019 Popular Post Share Posted May 12, 2019 (edited) Hi, This is for all who likes to add google analytics on their shop. If you are directly configuring 'Google analytics' by the module don't do it because it'll not work properly. You will get all the insights at first and after some time it'll stop giving insights at all. (Personal experience) So What I did is add this code in my header.tpl file in template/_partials but don't forget to add {literal}{/literal} at the starting and closing of the tag else you'll get a blank white page. {literal} <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-134165817-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-*********-*'); </script> {/literal} Hope it helps Edited May 16, 2019 by Himanshubishtt Update (see edit history) 10 12 Link to comment Share on other sites More sharing options...
toto__ Posted May 12, 2019 Share Posted May 12, 2019 Hi, Do you use google tag manager module at the same time ? Link to comment Share on other sites More sharing options...
Himanshubishtt Posted May 12, 2019 Author Share Posted May 12, 2019 No I am not using that module. Just added that script and everything is working fine. 1 Link to comment Share on other sites More sharing options...
facethefuture Posted May 20, 2019 Share Posted May 20, 2019 Hi, I tried this, however it did not track any revenue in our campaigns (adwords / mailing list) or in the ecommerce section of analytics, did this work for you? Link to comment Share on other sites More sharing options...
Himanshubishtt Posted May 21, 2019 Author Share Posted May 21, 2019 @facethefuture sir, that work for me perfectly. In which file do you add that code? Thanks Link to comment Share on other sites More sharing options...
facethefuture Posted May 21, 2019 Share Posted May 21, 2019 I placed it in the header.tpl. I have also tried the Prestashop analytics plugin (did not track correctly) and the a paid for module - Google Analytics Pro - which showed all revenue as direct traffic and did not work with campaigns for adwords / mailing lists etc. I'll give it another go and see if it works and let you know. Link to comment Share on other sites More sharing options...
Himanshubishtt Posted May 21, 2019 Author Share Posted May 21, 2019 (edited) Send me your website URL. And did you place the code at the top of the header.tpl? Edited May 21, 2019 by Himanshubishtt (see edit history) Link to comment Share on other sites More sharing options...
Ecorf Posted October 8, 2019 Share Posted October 8, 2019 Hey, I was about to launch my own website and was struggling like you with setting up google analytics, then found this www.nerdpilots.com/store and got done all that was left. Hope it helps. Link to comment Share on other sites More sharing options...
crestron_modules Posted December 6, 2019 Share Posted December 6, 2019 On 5/12/2019 at 8:47 AM, Himanshubishtt said: Hi, This is for all who likes to add google analytics on their shop. If you are directly configuring 'Google analytics' by the module don't do it because it'll not work properly. You will get all the insights at first and after some time it'll stop giving insights at all. (Personal experience) So What I did is add this code in my header.tpl file in template/_partials but don't forget to add {literal}{/literal} at the starting and closing of the tag else you'll get a blank white page. {literal} <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-134165817-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-*********-*'); </script> {/literal} Hope it helps This solution works 100% for PS version 1.7.5.2 Thanks. 1 Link to comment Share on other sites More sharing options...
nikdek69 Posted April 6, 2020 Share Posted April 6, 2020 hi, the code could be placed at the end of the file ? or it must be placed at the beginning ? Link to comment Share on other sites More sharing options...
AndyNZ Posted June 23, 2020 Share Posted June 23, 2020 On 5/12/2019 at 5:47 PM, Himanshubishtt said: Hi, This is for all who likes to add google analytics on their shop. If you are directly configuring 'Google analytics' by the module don't do it because it'll not work properly. You will get all the insights at first and after some time it'll stop giving insights at all. (Personal experience) So What I did is add this code in my header.tpl file in template/_partials but don't forget to add {literal}{/literal} at the starting and closing of the tag else you'll get a blank white page. {literal} <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-134165817-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-*********-*'); </script> {/literal} Hope it helps Works like a charm (with V1.7.6.5) To clarify: you have to edit the file header.tpl under your active theme. I put it right at the begin of the file (before {block name...}) just don't forget the {literal} and {/literal}... Link to comment Share on other sites More sharing options...
gusman126 Posted June 23, 2020 Share Posted June 23, 2020 Module https://gmartos.es/producto/registro-data-layer-configuracion-comercio-mejorado-usando-tag-manager-prestashop/ Link to comment Share on other sites More sharing options...
Surffari Posted June 25, 2020 Share Posted June 25, 2020 (edited) Hi All! I configured my shops vapura.cl, sebotanicals.com and gopure.shop first with the GA Module by Prestashop. The tracking was not enabled on all sites for some reasons, so I ended up adding the tracking code manually as instructed here too. I have now started to try to build analytics and metrics for growth hacking and have now understood the Prestashop module actually does all kinds of other things as well in addition to adding the tracking code to header. Is this correct??? I don't seem to get any enhanced ecommerce tracking. conversions etc in GA at all. Is the Prestashop GA module needed for this or are there other modules to enable full ecommerce tracking features or does it need to be built from scratch? Edited June 25, 2020 by Surffari (see edit history) Link to comment Share on other sites More sharing options...
gusman126 Posted June 25, 2020 Share Posted June 25, 2020 hace 1 hora, Surffari dijo: Hi All! I configured my shops vapura.cl, sebotanicals.com and gopure.shop first with the GA Module by Prestashop. The tracking was not enabled on all sites for some reasons, so I ended up adding the tracking code manually as instructed here too. I have now started to try to build analytics and metrics for growth hacking and have now understood the Prestashop module actually does all kinds of other things as well in addition to adding the tracking code to header. Is this correct??? I don't seem to get any enhanced ecommerce tracking. conversions etc in GA at all. Is the Prestashop GA module needed for this or are there other modules to enable full ecommerce tracking features or does it need to be built from scratch? You need a module to use enhanced ecommerce tracking The prestashop officer can serve you, although it has limitations You must buy a module so that the enhanced ecommerce tracking data is more accurate Link to comment Share on other sites More sharing options...
Surffari Posted June 25, 2020 Share Posted June 25, 2020 Thanks @gusman126 Can anyone recommend a good module (which you use, not trying to sell)? Or does anyone have any experience on building the funnel/roi etc tracking themselves? Link to comment Share on other sites More sharing options...
gusman126 Posted June 25, 2020 Share Posted June 25, 2020 hace 57 minutos, Surffari dijo: Thanks @gusman126 Can anyone recommend a good module (which you use, not trying to sell)? Or does anyone have any experience on building the funnel/roi etc tracking themselves? I have tried several, but in the end I have developed one with the necessary functions. Others, you can search in addons and ask in the forum, make a new topic Link to comment Share on other sites More sharing options...
jpas81 Posted July 5, 2020 Share Posted July 5, 2020 How I know if it works? Thanks Link to comment Share on other sites More sharing options...
AndyNZ Posted July 5, 2020 Share Posted July 5, 2020 5 hours ago, jpas81 said: How I know if it works? Thanks Go to your Google analytics account, watch the Real-time traffic. When you browse your web site you should see a change in the pageviews, it will also tell you what page is active. Link to comment Share on other sites More sharing options...
Antoine samesame Posted July 7, 2020 Share Posted July 7, 2020 Hello I am on Prestashop 1.7.6.5, I tried to make as told on /themes/sp_shop4u/templates/_partials/header.tpl, with {literal}and {/literal}....but it doesn't stay in the source code of my index page.... I tried also in head.tpl...same thing.... Somebody has any idea about the problem ? Thanks Link to comment Share on other sites More sharing options...
pokerman Posted July 7, 2020 Share Posted July 7, 2020 Hello, i do in the layout-both-columns.tpl file located in the ./themes/classic/templates/layouts/ directory Link to comment Share on other sites More sharing options...
Antoine samesame Posted July 8, 2020 Share Posted July 8, 2020 Thank you pokerman ! It's working ! Many many thanks ! Link to comment Share on other sites More sharing options...
lhpmpc Posted August 3, 2020 Share Posted August 3, 2020 On 5/12/2019 at 12:47 AM, Himanshubishtt said: Hi, This is for all who likes to add google analytics on their shop. If you are directly configuring 'Google analytics' by the module don't do it because it'll not work properly. You will get all the insights at first and after some time it'll stop giving insights at all. (Personal experience) So What I did is add this code in my header.tpl file in template/_partials but don't forget to add {literal}{/literal} at the starting and closing of the tag else you'll get a blank white page. {literal} <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-134165817-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-*********-*'); </script> {/literal} Hope it helps Muchas gracias, funciona muy bien, a mi también me dió error el módulo ya que oslo existe para prestashop 1.6 y no existe módulo ofoicial para prestashop 1.7, con el código manualmente funciona perfectamente.Thanks. Link to comment Share on other sites More sharing options...
EnriqueCastroRodrigu Posted September 30, 2020 Share Posted September 30, 2020 On 5/12/2019 at 7:47 AM, Himanshubishtt said: Hi, This is for all who likes to add google analytics on their shop. If you are directly configuring 'Google analytics' by the module don't do it because it'll not work properly. You will get all the insights at first and after some time it'll stop giving insights at all. (Personal experience) So What I did is add this code in my header.tpl file in template/_partials but don't forget to add {literal}{/literal} at the starting and closing of the tag else you'll get a blank white page. {literal} <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-134165817-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-*********-*'); </script> {/literal} Hope it helps Thank You. Nice 🙂 Link to comment Share on other sites More sharing options...
Lamyaspaska Posted December 14, 2020 Share Posted December 14, 2020 On 5/12/2019 at 8:47 AM, Himanshubishtt said: Hi, This is for all who likes to add google analytics on their shop. If you are directly configuring 'Google analytics' by the module don't do it because it'll not work properly. You will get all the insights at first and after some time it'll stop giving insights at all. (Personal experience) So What I did is add this code in my header.tpl file in template/_partials but don't forget to add {literal}{/literal} at the starting and closing of the tag else you'll get a blank white page. {literal} <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-134165817-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-*********-*'); </script> {/literal} Hope it helps Hello, the GA instructions say that this JS code must be placed within the <head></head> tags of the site, while this method places it bellow the </head> tag. Could this cause some issues? Thanks. Link to comment Share on other sites More sharing options...
gusman126 Posted December 14, 2020 Share Posted December 14, 2020 You must give consent, in the EU it is not useful to add the code, all the pages that have the code added are outside the new regulations and law you have to use modules and blocking cookies 1 Link to comment Share on other sites More sharing options...
EFFE1 Posted December 15, 2020 Share Posted December 15, 2020 Hello, i have an E-Commerce where Google Analytics don't go, so i have make a new installation of prestashop on another subdomain and instal the Google Analytics official module of Prestashop, insert the ID of google analytics but nothing happen! I think this must be a simple step, not a so and so complicated things to do, if the Prestashop official module don't go on a new installation, I think that there is a problem of code or java script that stop the flow of the information... What do you think's about it? Link to comment Share on other sites More sharing options...
Michi001 Posted February 28, 2021 Share Posted February 28, 2021 PS 1.7.7.1 Works perfect with New Analytics G4 code 😀 Link to comment Share on other sites More sharing options...
neich78 Posted October 28, 2021 Share Posted October 28, 2021 Not working for me. We still can't connect the service, we didn't find any configuration error in GA, this is the Prestashop backoffice message: "It seems you have a problem with your Google Analytics account. (Code:) Find more information in our Frequently Asked Questions. Using Prestashop 1.7.8.0 Link to comment Share on other sites More sharing options...
U1yss Posted February 9, 2022 Share Posted February 9, 2022 Presta 1.7.7.1 - works (finally), just note! you've got to add the code to head.tpl not header.tpl The official plugin Google Analytics v4.1.0 by PrestaShop is a waste Link to comment Share on other sites More sharing options...
gusman126 Posted February 9, 2022 Share Posted February 9, 2022 You must give consent, in the EU it is not useful to add the code, all the pages that have the code added are outside the new regulations and law you have to use modules and blocking cookies 1 Link to comment Share on other sites More sharing options...
rafaelvines Posted January 7, 2023 Share Posted January 7, 2023 I have tried million things in version 1.6.20 but nothing works. The modude doenst work, I have inserted the code directly in header.tpl of theme section but still dont work at all. any help? please Link to comment Share on other sites More sharing options...
psy_ch Posted January 18, 2023 Share Posted January 18, 2023 as gusman126 says, how do you prevent that from loading if the users do not want to be tracked? I do have to have a better solution :S Thanks gusman126, i nearly missed that very important point!!! Link to comment Share on other sites More sharing options...
Leolautzu Posted February 22, 2023 Share Posted February 22, 2023 Hi all, I am using prestashop and I need to insert a google tag only in one page of my theme. The page in question is the purchase summary page. From the back office I don't have the possibility to edit the page nor to insert the google html tag. The theme I use is Alysum. Prestashop 1.7.8.2. I have tried in the past to insert the tag in the entire header of the site but it does not calculate conversions well. Can anyone help me? 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