Check out the LimeSurvey source code on GitHub!

Google Analytics trackPageview function with question id or question number

4 years 7 months ago #82808 by autopoiesis
When I activate the "Track pages within survey" function in the survey settings, I can only see different pageviews for the survey groups but not for the single question pages in the GA content report. Is it possible to modify the code in replacements.php in a way that I can see the single question id or number in the content report?
$_trackURL = htmlentities($thissurvey['name'] . '-[' . $surveyid . ']/[' . $gseq . ']-' . $_groupname, ENT_QUOTES);

It is important for me to define different goals within the survey - so I need real single pageviews.

Please Log in to join the conversation.

4 years 7 months ago #82813 by TMSWhite
We anticipated that users might want different ways of using GA, so it is pretty easy to extend.

Are you using question-by-question mode? GA is currently configured for group-by-group mode.

If you're comfortable with the code and GitHub, the easiest way is to fork LimeSurvey, add a new 'googleanalyticsstyle', and try some combinations $_trackURL until you're happy with the results. Then you can issue a pull request and we can review it for possible inclusion in the base code.

I found I had to go through some trial and error in building the current GA support before it met my needs, so I recommend playing with it yourself.

Please Log in to join the conversation.

4 years 7 months ago #82826 by Mazi
Tom, I couldn't find this additional information about how the GA feature works at the wiki. If I didn't over-read it, can you please ad it?!


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)'"

Please Log in to join the conversation.

4 years 2 months ago #89898 by autopoiesis
I solved my problem with the standard group-by-group modus: I just created some extra question groups for my different goals.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form