Check out the LimeSurvey source code on GitHub!

Capture part of a URL in the data

More
5 years 5 months ago #65607 by vadindot
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.

Please Log in to join the conversation.

More
5 years 5 months ago - 5 years 5 months ago #65675 by tpartner
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: 5 years 5 months ago by tpartner.

Please Log in to join the conversation.

More
5 years 5 months ago #65676 by tpartner
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.

Please Log in to join the conversation.

More
5 years 5 months ago #65677 by vadindot
cool, thanks!

Please Log in to join the conversation.

More
5 years 5 months ago #65860 by Mazi

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)survey-consulting.com'"

Please Log in to join the conversation.

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