jmeca Posted April 14, 2022 Posted April 14, 2022 Hello, does anyone know how I can add the code for Google analytics 4 ? I think it could be done through the custom code, but not functional in multishop. I think someone had a module for this but I don't remember the name or the page to download it.
0 jmeca Posted June 5, 2022 Author Posted June 5, 2022 In case anyone is interested, in the following link you can download the free module for Google tagmanager compatible with thirtybees I have installed it, I'm testing it and so far everything seems ok https://github.com/MSiliunas/Prestashop-GoogleTagManager/issues/1 Prestashop-GoogleTagManager-PS16.zip
0 danwarrior Posted May 20, 2022 Posted May 20, 2022 On 4/14/2022 at 9:57 AM, jmeca said: Hello, does anyone know how I can add the code for Google analytics 4 ? I think it could be done through the custom code, but not functional in multishop. I think someone had a module for this but I don't remember the name or the page to download it. Did you solve this? I'm in the same issue... thanks!
0 janoo Posted May 24, 2022 Posted May 24, 2022 (edited) In our company we offten use module:https://addons.prestashop.com/en/analytics-statistics/27146-premium-google-tag-manager.html it´s not cheap at all, but our guys from marketing and analytics are very satisfied and they use it 5 years already without issues or needs for something more accurate Edited May 24, 2022 by janoo 1
0 Willem Posted May 24, 2022 Posted May 24, 2022 ok, i don't have a multishop, but for a "single" shop setup this works for me: You create your GA4 tag in google analytics first. You will get code like this, change the id G-58HPYXXXXX to your own id. <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-58HPYXXXXX"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-58HPYXXXXX'); </script> copy this code in: (instellingen is dutch for Settings) 3
0 wakabayashi Posted May 25, 2022 Posted May 25, 2022 (edited) No idea, why this additional weren't implemented multistore ready. Makes not a lot of sense to me. Probably it just got forgotten. When the coder don't work on multistore you can easily forget. I don't have time to fix it, but I can give you a simple (dirty) solution: Open header.tpl in your theme Search for the "</head>" tag. Just before add your code in this schema {if $cart->id_shop==1}/* Your Code for shop with id 1 */{/if} {if $cart->id_shop==2}/* Your Code for shop with id 2 */{/if} {if $cart->id_shop==3}/* Your Code for shop with id 3 */{/if} That was the way I started coding 5 years ago ^^ Edited May 25, 2022 by wakabayashi 1
0 datakick Posted May 25, 2022 Posted May 25, 2022 Ability to have custom code per store is added in bleeding edge 1 2
0 wakabayashi Posted May 25, 2022 Posted May 25, 2022 1 hour ago, datakick said: Ability to have custom code per store is added in bleeding edge Amazing 🤩
Question
jmeca
Hello, does anyone know how I can add the code for Google analytics 4 ?
I think it could be done through the custom code, but not functional in multishop.
I think someone had a module for this but I don't remember the name or the page to download it.
7 answers to this question
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