- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
It doesn't work with Google Analytics 4
- osvaldopt
- Topic Author
- Offline
- New Member
Less
More
1 year 2 months ago #240177
by osvaldopt
It doesn't work with Google Analytics 4 was created by osvaldopt
Your LimeSurvey version: 5.6.4
Own server or LimeSurvey hosting: q-staging.greenpeace.es/index.php?r=surv...x&sid=559519&lang=es
Survey theme/template: q-staging.greenpeace.es/index.php?r=surv...x&sid=559519&lang=es
==================
Google traditional Analytics is deprecated and will stop working in June. So as the old tagging method. However if I insert my GA4 ID in LimeSurvey it doesn't work because it generates the old ga code instead of the new gtag. Here's what's inserting:
<script>
(function(i,s,o,g,r,a,m){ i=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments) },i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'G-0VT32NXNBN', 'auto'); // Replace with your property ID.
ga('send', 'pageview');
</script>
It should use Google's Gtag. Here's the documentation developers.google.com/tag-platform/gtagjs/install
Own server or LimeSurvey hosting: q-staging.greenpeace.es/index.php?r=surv...x&sid=559519&lang=es
Survey theme/template: q-staging.greenpeace.es/index.php?r=surv...x&sid=559519&lang=es
==================
Google traditional Analytics is deprecated and will stop working in June. So as the old tagging method. However if I insert my GA4 ID in LimeSurvey it doesn't work because it generates the old ga code instead of the new gtag. Here's what's inserting:
<script>
(function(i,s,o,g,r,a,m){ i=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments) },i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'G-0VT32NXNBN', 'auto'); // Replace with your property ID.
ga('send', 'pageview');
</script>
It should use Google's Gtag. Here's the documentation developers.google.com/tag-platform/gtagjs/install
Please Log in to join the conversation.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11661
- Thank you received: 2742
1 year 2 months ago #240187
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic It doesn't work with Google Analytics 4
There has already been a post about this: Please join forces instead of distributing the information in different posts.
forums.limesurvey.org/forum/can-i-do-thi...tion-with-limesurvey
Posting here in the forum will have little to no effect. There needs to be a bug report / feature request.
Depending on your version of LS chances can be higher or lower for this to be implemented. My guess ist that the new implementation of GA4 won't make it into LS 3.x because I think its support will run out soon. But there are good chances that it will be implemented in LS 5.
What is tricky though: How to implement it, without destroying installations that have not yet made the switch to GA4 and still use the old code until June.
forums.limesurvey.org/forum/can-i-do-thi...tion-with-limesurvey
Posting here in the forum will have little to no effect. There needs to be a bug report / feature request.
Depending on your version of LS chances can be higher or lower for this to be implemented. My guess ist that the new implementation of GA4 won't make it into LS 3.x because I think its support will run out soon. But there are good chances that it will be implemented in LS 5.
What is tricky though: How to implement it, without destroying installations that have not yet made the switch to GA4 and still use the old code until June.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Please Log in to join the conversation.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
1 year 2 months ago #240189
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic It doesn't work with Google Analytics 4
Surely you can place the necessary GA code directly in a theme TWIG file. No?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Please Log in to join the conversation.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11661
- Thank you received: 2742
1 year 2 months ago #240190
by holch
Of course you can do it the manual way. No problem. But they are asking about the implementation within Limesurvey. If the old code won't work anymore, it makes sense to either adapt the functionality in Limesurvey or get completely rid of it (probably not an option ).
Currently you can setup Google Analytics on the global level and on a survey level by providing an ID. Especially the survey level would probably quite though within the theme. I don't use it, but obviously people use it out there. It is already the second poster with the same concern.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic It doesn't work with Google Analytics 4
Surely you can place the necessary GA code directly in a theme TWIG file. No?
Of course you can do it the manual way. No problem. But they are asking about the implementation within Limesurvey. If the old code won't work anymore, it makes sense to either adapt the functionality in Limesurvey or get completely rid of it (probably not an option ).
Currently you can setup Google Analytics on the global level and on a survey level by providing an ID. Especially the survey level would probably quite though within the theme. I don't use it, but obviously people use it out there. It is already the second poster with the same concern.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Please Log in to join the conversation.
- osvaldopt
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
1 year 2 months ago - 1 year 2 months ago #240196
by osvaldopt
Replied by osvaldopt on topic It doesn't work with Google Analytics 4
I did that (adding it to the Twig) I was just reporting that the bug exists. I didn't found an issue tracker to report the bug. Github has it disabled and if it exists, it's not easy to find.
Last edit: 1 year 2 months ago by osvaldopt. Reason: Clarify
Please Log in to join the conversation.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11661
- Thank you received: 2742
1 year 2 months ago - 1 year 2 months ago #240202
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic It doesn't work with Google Analytics 4
bugs.limesurvey.org/
Limesurvey.org --> Community --> Contribute - Bug Tracker
I agree that it could be easier. But nothing a Google search for "bug+limesurvey" wouldn't solve.
Limesurvey.org --> Community --> Contribute - Bug Tracker
I agree that it could be easier. But nothing a Google search for "bug+limesurvey" wouldn't solve.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Last edit: 1 year 2 months ago by holch.
Please Log in to join the conversation.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11661
- Thank you received: 2742
1 year 2 months ago #240232
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic It doesn't work with Google Analytics 4
So I had a quick chat with one of the developers and according to him in LS5 this should work.
And as expected, there are no plans to adapt LS3 for this change. It is in a phase where no new features should be added and I expect it to be EOL still this year.
So there are good reasons to move on to LS5.
And as expected, there are no plans to adapt LS3 for this change. It is in a phase where no new features should be added and I expect it to be EOL still this year.
So there are good reasons to move on to LS5.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Please Log in to join the conversation.