Welcome, Guest
Username: Password: Remember me

TOPIC: Google Analytics trackPageview function with question id or question number

Google Analytics trackPageview function with question id or question number 2 years 3 months ago #82808

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.
The administrator has disabled public write access.

Re: Google Analytics trackPageview function with question id or question number 2 years 3 months ago #82813

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
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.
The administrator has disabled public write access.

Re: Google Analytics trackPageview function with question id or question number 2 years 3 months ago #82826

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
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?!

Thanks!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Aw: Re: Google Analytics trackPageview function with question id or question number 1 year 10 months ago #89898

I solved my problem with the standard group-by-group modus: I just created some extra question groups for my different goals.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.154 seconds
Donation Image