Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

One click to prefill and submit a survey using URL fields

  • phplist
  • phplist's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 7 months ago - 6 years 7 months ago #166322 by phplist
Hi All, user of LimeSurvey hosted here. We've used URL fields successfully, but so far we're lacking the ability to submit the survey via prefilled fields. The use case is an email campaign where recipients can click an image to submit their response, like this

The link to LimeSurvey therefore needs to include the prefilled values (no problem there) and also the instruction to submit the survey immediately, without loading of the survey page with prefilled fields.

The benefit of this approach is that in a single click the data is recorded -- no opportunity for drop outs, overlooking the submit button (on small screens) etc.

Is this possible?

Open Source email marketing and analytics established in 2000. Available self-hosted, and with fully managed plans at phplist.com.
Last edit: 6 years 7 months ago by phplist.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 7 months ago - 6 years 7 months ago #166328 by tpartner
If you need to use LimeSurvey to collect the data, I would direct them to a PHP page that loads a response via the API add_response() method.

- www.limesurvey.org/manual/RemoteControl_2_API
- api.limesurvey.org/classes/remotecontrol...#method_add_response

Here are a couple of examples:

- www.limesurvey.org/forum/installation-a-...-sent-via-rc2#163916
- www.limesurvey.org/forum/can-i-do-this-w...-add-response#162815

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 6 years 7 months ago by tpartner.
The topic has been locked.
  • phplist
  • phplist's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 7 months ago #166389 by phplist
Very helpful, thanks!

Open Source email marketing and analytics established in 2000. Available self-hosted, and with fully managed plans at phplist.com.
The topic has been locked.
More
6 years 7 months ago #166392 by jelo

phplist wrote: and also the instruction to submit the survey immediately, without loading of the survey page with prefilled fields.

In other words: If the submit button would be triggered via Javascript after loading the page, it would fit your requirement? BTW: What version of LimeSurvey is used?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 7 months ago #166401 by tpartner
I think the API would be cleaner and more robust than a JS solution to trigger the submit in LimeSurvey.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • phplist
  • phplist's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 7 months ago #166445 by phplist

jelo wrote:

phplist wrote: and also the instruction to submit the survey immediately, without loading of the survey page with prefilled fields.

In other words: If the submit button would be triggered via Javascript after loading the page, it would fit your requirement? BTW: What version of LimeSurvey is used?


We're using LimeSurvey hosted (limequery.com). The JS method sounds like a potentially awkward workaround...

Open Source email marketing and analytics established in 2000. Available self-hosted, and with fully managed plans at phplist.com.
The topic has been locked.
More
6 years 7 months ago #166465 by jelo

tpartner wrote: I think the API would be cleaner and more robust than a JS solution to trigger the submit in LimeSurvey.

What do you mean by writing "cleaner"? The question "Is it robust?" comes to my mind by every workaround in LS. I often wonder that is works without too many complains from the client browser side. A server side scripting which would allow triggering events (e.g. submitting or sending emails) would be great. A autosubmitt-setting on groups/questions or a special redirector questiontype (which is currently done via quota workaround) might be a feature request.

Since LimeSurvey GmbH is betting on pure LS SaaS business the external script hosted somewhere else seems to be not suitable for many customers they are aiming for.

We're using LimeSurvey hosted (limequery.com)

The version is shown at the bottom of the page.
Try to click on the version number. The newer versions offer more infos about the installation.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 7 months ago #166471 by tpartner

The question "Is it robust?" comes to my mind by every workaround in LS.

I realize that you have a dislike/distrust for all workarounds but I think that they are one if the reasons that LimeSurvey is so flexible.

I often wonder that is works without too many complains from the client browser side. A server side scripting which would allow triggering events (e.g. submitting or sending emails) would be great.

My suggestion to use the API is a server-side solution.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
6 years 7 months ago #166478 by jelo

tpartner wrote: I realize that you have a dislike/distrust for all workarounds

Which comes from the first time using LimeSurvey with a workaround in the old days. Hidden field with random number wasn't hidden for some browsers. Respondents entered numbers in the random number field ;-)

My suggestion to use the API is a server-side solution.

I'm aware of that. The distinction here was inside or outside of LimeSurvey. Reducing dependency with outside scripts might be a reason too.

I second your reasoning with more robustness via API.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose