View Issue Details

This bug affects 2 person(s).
 18
IDProjectCategoryView StatusLast Update
18197Feature requestsSurvey takingpublic2023-07-17 18:07
Reportergabrieljenik Assigned Toc_schmitz  
PriorityhighSeverityfeature 
Status resolvedResolutionfixed 
Summary18197: Allow GA4 tracking
Description

GA4 setup code is different than UA.

GA4

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

  gtag('config', 'G-4J62DGSRE5');
</script>

UA

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

  gtag('config', 'UA-163401370-1');
</script>

We might need to identify which JS code to inject depending on the start of the tag.
If not, we might need to add a google analytics type selector on survey and global settings.

TagsNo tags attached.
Bug heat18
Story point estimate0
Users affected %0

Users monitoring this issue

chimp358

Activities

gabrieljenik

gabrieljenik

2023-02-10 00:52

manager   ~73785

https://github.com/LimeSurvey/LimeSurvey/pull/2907

Not sure about the Google Analytics code produced for survey/group tracking.
https://github.com/LimeSurvey/LimeSurvey/pull/2907/files#diff-c9cddde7e9d0b0168164593bd794cc64e96dbcd2805811175cfe5815465cb42cR56

Someone knows a bit more about that? Someone can test it from the Google Analytics side and tell if the info received makes sense?

Mazi

Mazi

2023-03-01 15:30

updater   ~73999

@gabrieljenik, did we already integrate this into LS 3.x as well? Two customers recently reported that they are facing the same issue with the new GA 4.

gabrieljenik

gabrieljenik

2023-03-02 14:16

manager   ~74006

No, I will work on that

Mazi

Mazi

2023-03-02 15:30

updater   ~74008

Thanks a million, @gabrieljenik!

gabrieljenik

gabrieljenik

2023-03-02 18:34

manager   ~74012

PR LTS: https://github.com/LimeSurvey/LimeSurvey/pull/2962

gabrieljenik

gabrieljenik

2023-03-02 18:35

manager   ~74013

@Mazi can you test it from the Google Analytics side and tell if the info received makes sense?

Mazi

Mazi

2023-03-03 17:17

updater   ~74026

@gabrieljenik, I can not update the customer system by cherry picking, sorry.
Maybe ping one of the users at https://bugs.limesurvey.org/view.php?id=14310 to test?

gabrieljenik

gabrieljenik

2023-03-17 13:55

manager   ~74157

Tested this.

UA:
(attachment)

GA4:
(attachment)

Haven't checked looking at this on the GA side.

image.png (23,808 bytes)   
image.png (23,808 bytes)   
image-2.png (94,535 bytes)   
image-2.png (94,535 bytes)   
gabrieljenik

gabrieljenik

2023-03-17 13:56

manager   ~74158

I believe that this could be merged, right?
Waht do you think according to the tests done?

ollehar

ollehar

2023-03-17 14:00

administrator   ~74159

Merged it.

c_schmitz

c_schmitz

2023-03-29 14:14

administrator   ~74306

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=34401

guest

guest

2023-07-17 18:07

viewer   ~76112

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=35148

Related Changesets

LimeSurvey: master 5b1d93b7

2023-02-22 14:04:47

Gabriel Jenik


Committer: c_schmitz Details Diff
New feature 18197: Allow Google Analytics 4 tracking (#2907) Affected Issues
18197
mod - themes/survey/vanilla/views/subviews/header/google_analytics.twig Diff File

LimeSurvey: master 980d7735

2023-02-22 14:04:47

Gabriel Jenik


Committer: GitHub Details Diff
New feature 18197: Allow Google Analytics 4 tracking (#2907) Affected Issues
18197
mod - themes/survey/vanilla/views/subviews/header/google_analytics.twig Diff File

Issue History

Date Modified Username Field Change
2022-06-17 18:27 gabrieljenik New Issue
2023-02-08 11:24 c_schmitz Assigned To => gabrieljenik
2023-02-08 11:24 c_schmitz Priority none => high
2023-02-08 11:24 c_schmitz Status new => assigned
2023-02-08 11:24 c_schmitz Story point estimate => 0
2023-02-08 11:24 c_schmitz Users affected % => 0
2023-02-10 00:52 gabrieljenik Status assigned => ready for code review
2023-02-10 00:52 gabrieljenik Note Added: 73785
2023-02-10 00:52 gabrieljenik Bug heat 0 => 2
2023-03-01 15:30 Mazi Note Added: 73999
2023-03-01 15:30 Mazi Bug heat 2 => 4
2023-03-02 14:16 gabrieljenik Note Added: 74006
2023-03-02 15:30 Mazi Note Added: 74008
2023-03-02 15:31 guest Bug heat 4 => 10
2023-03-02 18:34 gabrieljenik Note Added: 74012
2023-03-02 18:34 gabrieljenik Assigned To gabrieljenik => DenisChenu
2023-03-02 18:35 gabrieljenik Note Added: 74013
2023-03-03 17:17 Mazi Note Added: 74026
2023-03-03 18:03 DenisChenu Assigned To DenisChenu =>
2023-03-03 18:03 DenisChenu Status ready for code review => ready for testing
2023-03-09 03:43 chimp358 Issue Monitored: chimp358
2023-03-09 03:43 chimp358 Bug heat 10 => 12
2023-03-17 13:55 gabrieljenik Note Added: 74157
2023-03-17 13:55 gabrieljenik File Added: image.png
2023-03-17 13:55 gabrieljenik File Added: image-2.png
2023-03-17 13:56 gabrieljenik Assigned To => ollehar
2023-03-17 13:56 gabrieljenik Status ready for testing => ready for merge
2023-03-17 13:56 gabrieljenik Note Added: 74158
2023-03-17 14:00 ollehar Note Added: 74159
2023-03-17 14:00 ollehar Bug heat 12 => 14
2023-03-17 14:01 ollehar Status ready for merge => resolved
2023-03-17 14:01 ollehar Resolution open => fixed
2023-03-29 14:14 c_schmitz Changeset attached => LimeSurvey master 5b1d93b7
2023-03-29 14:14 c_schmitz Note Added: 74306
2023-03-29 14:14 c_schmitz Bug heat 14 => 16
2023-03-29 14:14 c_schmitz Assigned To ollehar => c_schmitz
2023-07-17 18:07 Changeset attached => LimeSurvey master 980d7735
2023-07-17 18:07 guest Note Added: 76112
2023-07-17 18:07 guest Bug heat 16 => 18