0 votes
in SoSci Survey (English) by s365685 (110 points)

I'm using SoSci Survey for a study where participants are recruited both via
SONA and through other channels. Only the participants who come via SONA should
be credited and redirected back to SONA at the end.

Project name: Perception of a Digital Avatar in Mental Health Screening

Normal survey link: https://soscisurvey.de/digital-avatar/
SONA survey link: https://soscisurvey.de/digital-avatar/?r=%SURVEY_CODE%

On the second-to-last page of my questionnaire, I use the following PHP code
to redirect SONA participants back to SONA so they receive credit:

if (reference() != '') {
redirect('https://fu-berlin.sona-systems.com/webstudy_credit.aspx?experiment_id=444&credit_token=c0409cb5e08c4e498bec96e770ef8aa3&survey_code=%reference%',
false);
}

However, when I tested this, ALL participants were redirected to SONA at the
end of the survey, which is not right.

This suggests that reference() is returning a non-empty value even when no
SONA reference code was actually passed in the URL, which is why the
condition "reference() != ''" is always evaluating as true.

Could you help me understand why this might be happening, and how to
correctly check whether a participant actually came from SONA before
redirecting them?

1 Answer

0 votes
by SoSci Survey (376k points)

Did you place the redirect only in the PHP code or did you create a "Panel Redirects" elements in addition? If you did so, please remove that from the questionnaire. Otherwise, it will redirect everyone. The PHP code is aufficient. The "Panel Redirects" element is just an alternative.

If that is not the case, please check your dataset for the REF variable. Is there anything for non-Sona-respondents?

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...