Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Capture part of a URL in the data

Capture part of a URL in the data 4 years 10 months ago #65607

  • vadindot
  • vadindot's Avatar
  • Offline
  • Senior Lime
  • Posts: 55
  • Thank you received: 1
  • Karma: 0
I have a project coming up with eRewards. They include "ftouch=XXXXX" in the URL for the survey to keep track of participation. I use the passthrough function to send it back to them in the exit URL, but I am wondering if I can also capture the "ftouch" value in the data somehow.
The administrator has disabled public write access.

Capture part of a URL in the data 4 years 10 months ago #65675

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6133
  • Thank you received: 1362
  • Karma: 535
You can load it into a hidden short-text question. Replace "QQ" with the short-text question ID.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		// Hide the question
		$('#questionQQ').hide();
 
		// Get the URL param
		var ftouch = getURLParameter('ftouch');
 
		// Load the hidden question
		$('#questionQQ input.text').val(ftouch);
	});
 
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 4 years 10 months ago by tpartner.
The administrator has disabled public write access.

Capture part of a URL in the data 4 years 10 months ago #65676

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6133
  • Thank you received: 1362
  • Karma: 535
Sorry, forgot some requirements for this to work:

- The hidden question must be on the first page
- The welcome screen must be skipped.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

Capture part of a URL in the data 4 years 10 months ago #65677

  • vadindot
  • vadindot's Avatar
  • Offline
  • Senior Lime
  • Posts: 55
  • Thank you received: 1
  • Karma: 0
cool, thanks!
The administrator has disabled public write access.

Capture part of a URL in the data 4 years 10 months ago #65860

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5974
  • Thank you received: 366
  • Karma: 260
vadindot wrote:
cool, thanks!
You're welcome!

If our hints have been helpful and you enjoy limesurvey please consider a donation to the team .
We do all this in our free time and you don't have to pay a penny for this software.

Without your help we can't keep this project alive.

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.
Moderators: ITEd
Time to create page: 0.598 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form