Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Determine if a user has completed a survey from an external site/forum.

Determine if a user has completed a survey from an external site/forum. 2 years 9 months ago #71771

  • pjansell
  • pjansell's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 8
  • Karma: 0
I have created a survey which does not require user registration (anonymous access) and I would like to provide a pop up with a URL linking to the survey from an external forum, for the benefit of our forum members (essentially it’s a survey on how we can improve the forum).

What would be the best way of ascertaining whether a user has completed the survey or not from the forum?

Obviously if they've filled in the survey I wouldn't want to present the pop up link again, what would be the best way of determining completion of the survey, given it’s anonymous by nature?

Would it possible to interrogate the survey results database externally from the forum site (both hosted on the same server in different virtual directories), and check for a client IP address, or perhaps a cookie created on completion of the survey, which could then be checked for existence via the forum?
Last Edit: 2 years 9 months ago by pjansell.
The administrator has disabled public write access.

Aw: Determine if a user has completed a survey from an external site/forum. 2 years 9 months ago #71781

  • Steve
  • Steve's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 494
  • Thank you received: 46
  • Karma: 17
Hello,

LimeSurvey uses a cookie to determine the status of the survey. You can have a look at www.limesurvey.org/de/forum/can-i-do-thi...ionredirecting#70571 to find out more about this cookie. But even the cookie could be deleted if the user clears his/her browser/cookies. Perhaps you can save the information to a database you have access to. Otherwise your user might get the link if they close their browser, clear their cookies or the session expires.
Mit freundlichen Grüßen/Best regards,

Stefan Gohlke
LimeSurvey Team
The administrator has disabled public write access.

Re: Aw: Determine if a user has completed a survey from an external site/forum. 2 years 9 months ago #71786

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
Hmm, this is a litle tricky. One solution might be to pass some user ID by URL when calling the survey from the forum. Pass it by URL into a hidden text question and then use the end URL feature to redirect the user to a to be coded script. This script gets passed the user ID back from the hidden question by URL, reads out the user ID and then sets some flag at the forum database.
When that user visits the forum the next time you should always let the popup check if the user has already completed the survey.

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.

Re: Determine if a user has completed a survey from an external site/forum. 2 years 9 months ago #71826

  • pjansell
  • pjansell's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 8
  • Karma: 0
Thanks for your help - the problem with passing an ID string is that a significant portion of our forums viewers don't actually log in to the forum, they are casual browsers so to speak, so i want to make sure i can capture their input along with those who do actually log in.

Given the unreliability of a purely cookie based approached, I see it's possible to record an IP address against an individual who has taken the survey. Perhaps a combination of the two approaches would suffice?

Therefore, is it feasible to test for the existance of an IP address in the limesurvey survey database remotely from a script residing in the forum directory (both existing on the same web server, but different virtual directories/domains)? Is that possible in PHP?

Similarly, is it possible at the start/end of a survey to write a value (i.e address) to database in the forum site?

Testing for both IP address and a cookie wouldn't be bomb proof but at least those who have filled in the survey (and assuming they are using the same machine, or are on a fixed or long leased IP address) won't be trouble too much by the pop up?

Perhas there is another way?
The administrator has disabled public write access.

Re: Determine if a user has completed a survey from an external site/forum. 2 years 9 months ago #71859

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
Using the IP address doesn't really solve your problem e.g. when I'm disconnected from the internet and connect again, my ISP assigns a different IP to me.

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.

Re: Determine if a user has completed a survey from an external site/forum. 2 years 9 months ago #71869

  • pjansell
  • pjansell's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 8
  • Karma: 0
Yes agreed Mazi - is it possible to remotely test for the existance of an IP address in the limesurvey survey database from a script residing in my forum website directory?
The administrator has disabled public write access.

Re: Determine if a user has completed a survey from an external site/forum. 2 years 9 months ago #71875

  • Steve
  • Steve's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 494
  • Thank you received: 46
  • Karma: 17
Hello,

I'm no expert but I think it depends on the database you use or how the database is configured or accessable. You could try to establish a database connection to the database-server you are using and use a select statement to get the results you want. I'm not sure if it works but I imported/required
require_once(dirname(__FILE__).'/limesurvey/config-defaults.php');
require_once(dirname(__FILE__).'/limesurvey/common.php');
and used the function "db_execute_assoc($sqlquery,'',true)" to get what I want.
Mit freundlichen Grüßen/Best regards,

Stefan Gohlke
LimeSurvey Team
Last Edit: 2 years 9 months ago by Steve.
The administrator has disabled public write access.

Re: Determine if a user has completed a survey from an external site/forum. 2 years 9 months ago #71882

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
pjansell, theoretically this is possible if IP addresses are tracked correctly (see survey settings). Grab all IPs of the users who have answered the survey from the lime_survey_12345 table and match that with the cuirrent user's IP.

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.

Re: Determine if a user has completed a survey from an external site/forum. 2 years 9 months ago #71903

  • pjansell
  • pjansell's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 8
  • Karma: 0
Mazi - as we agree and you pointed out, it's not 100% bomb proof matching by IP address either especially if for example a forum user in the first instance, is using her laptop to access the forum, is presented with the pop-up for the survey invite, proceeds to fill in the survey BUT the following day decides to access the forum from her work computer, and the cycle begins again, which flaws the intended idea.

It's certainly more robust then just reliance on cookies, but very fallible all the same, wouldn't you agree?

vierundzwanzig, that code is interesting, thanks for the input. If i have understood you correctly did you call that code from an external script residing in another virtual directory? There could be some hope after all if i could either write (IP addr) values from the survey to a forum database, or the other way around...read IP values held in the survey database remotely from the forum - either way would work, if theres a proven coding means for doing so?

and thanks guys..appreciate the help with this one as always...
Last Edit: 2 years 9 months ago by pjansell.
The administrator has disabled public write access.

Re: Determine if a user has completed a survey from an external site/forum. 2 years 9 months ago #71908

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6429
  • Thank you received: 840
  • Karma: 249
Hello,

I think the best is to present the survey only to connected people, link survey and user with an token table with an attribute for user id.
You can fill the answer table from the first application with a php script, or fill it before and put the token in the first application.

And for not connected people : use cookies to send a alert for "There are a survey to complete for connected user : please click here to connect and fill the survey".
Put a cookie to hide this windows after the first time, and in the user profile put a link to the survey.

Denis
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.181 seconds
Donation Image