Welcome, Guest
Username: Password: Remember me

TOPIC: Capture part of a URL in the data

Capture part of a URL in the data 3 years 1 month ago #65607

  • vadindot
  • vadindot's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 51
  • 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.

Re: Capture part of a URL in the data 3 years 1 month ago #65675

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4270
  • Thank you received: 803
  • Karma: 368
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 3 years 1 month ago by tpartner.
The administrator has disabled public write access.

Re: Capture part of a URL in the data 3 years 1 month ago #65676

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4270
  • Thank you received: 803
  • Karma: 368
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Capture part of a URL in the data 3 years 1 month ago #65677

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

Re: Capture part of a URL in the data 3 years 1 month ago #65860

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
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.103 seconds
Donation Image