Alert Message when Participant closes Survey

More
3 years 7 months ago #118939 by Jean_luetz
Jean_luetz created the topic: Alert Message when Participant closes Survey
Dear all,

I am running an experiment through LimeSurvey and experiencing significant drop-out. The thing is, I would like to see all my particpants properly debriefed, even if they decide to quit. I cannot collect Email addresses in advance, so this is not an option.

I would rather like to display an alert message if a participant tries to close the window/tab. Is there a way to get this working in all major browsers? It would be necessary to display a custom alert message including a link to the full debriefing.

Any ideas on the matter are very appreciated? I would also be interested to hear about different approaches to tackle the issue.

Cheers,
J.

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #118942 by tpartner
tpartner replied the topic: Alert Message when Participant closes Survey

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: Jean_luetz

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #118948 by Jean_luetz
Jean_luetz replied the topic: Alert Message when Participant closes Survey
Great! I´m having a look. Thanks!

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #118957 by holch
holch replied the topic: Alert Message when Participant closes Survey
Drop outs can have various reasons.

From my experience, respondents usually drop out within the first 2-3 questions / pages. After that, the ones that just wanted "to have a look" are gone and most go through to the end. However, this is for surveys of around 8-10 minutes. If you go significantly over that, chances are high that people drop out.

My experience also shows that long item batteries and especially big matrix questions are also a place where many drop out. Open ended questions as well.

So you might also want to look into a few other things like: survey time, complicated questions, boring topic, etc.

Often with small changes you can get a far better result.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #118962 by Jean_luetz
Jean_luetz replied the topic: Alert Message when Participant closes Survey
I fully agree! Actually I´m not really concerned with the drop outs themselves. As you said, most drop outs are people just "having a look" and then quitting. But my survey aims at a sensitive topic and some questions being asked have the potential to simply make people feel down. So for me the issue is to take care about those participants that are halfway through and then decide to quit. I would like to at least give them the opportunity to read the debriefing information and not just leave them alone feeling annoyed.

@tpartner
Thanks again, the workaround does it. Do I understand correctly that there´s no way to get custom messages displayed on mozilla engines?

Thanks and cheers,
J.

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #118963 by jonsen
jonsen replied the topic: Alert Message when Participant closes Survey
Hi Jean_luetz,

you may try to add an alert (JS function to display a notice):
                //e.stopPropagation works in Firefox.
                if (e.stopPropagation) {
                        alert('Before you leave the survey, please note that.......');
                        e.stopPropagation();
                        e.preventDefault();
                }

I'm not sure if this is correct, but if it doesn't work, answer here and I will try it out later myself...

Best
Jonsen
The following user(s) said Thank You: Jean_luetz

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago - 3 years 7 months ago #118968 by Jean_luetz
Jean_luetz replied the topic: Alert Message when Participant closes Survey
Thanks a lot jonsen!

So I put in your code, but it didn´t really work. This is my function now:
function goodbye(e) {
    if(!$('body', top.document).hasClass('submitted') && !$('#completed').length && !$('.templateeditor', top.document).length) { //check if a button was used to navigate OR the survey is completed OR the template is displayed in the template editor
 
 
                 //e.stopPropagation works in Firefox.
                if (e.stopPropagation) {
                        alert('Please read the debriefing');
                        e.stopPropagation();
                        e.preventDefault();
                }
 
                return 'Are you sure you want to quit this survey?If you do, please make sure to read the DeBRIEFING Info'; // For chrome
        }
}
 
window.onbeforeunload = goodbye;
 
$(document).on('click', '.button, .changelang, [name="move"]', function(event){ //added .changelang here, please add other classes if you know which should be allowed to navigate
        $('body', top.document).addClass('submitted');
});

In Chrome, Message #2 is presented ("Are you sure you want to quit this survey?..."). IE displays both messages sequentially. In Firefox, there is no alert at all.

If I put in this snippet from the Workaround,
if(!e) e = window.event;
                //e.cancelBubble is supported by IE - this will kill the bubbling process.
                e.cancelBubble = true;
                e.returnValue = 'Are you sure you want to quit this survey?'; //This is displayed on the dialog for IE

Firefox displays its generic warning message.

Any ideas?

BTW: I am using Chrome Version 41.0.2272.118 m, IE 11.09600 and Firefox 37.0.1, these should all be the latest releases.

Thanks again cheers,
J.
Last Edit: 3 years 7 months ago by Jean_luetz. Reason: mistake

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #118971 by tpartner
tpartner replied the topic: Alert Message when Participant closes Survey
Hmm...it looks like Firefox added a "feature" that disallows custom messages in the onbeforeunload event and are too arrogant to listen to users and fix it - bugzilla.mozilla.org/show_bug.cgi?id=641509

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #118977 by Jean_luetz
Jean_luetz replied the topic: Alert Message when Participant closes Survey
thanks tpartner. What a great feature...

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!