Translations of this page:

Multi-Wave Surveys with Self-Recruited Respondents

If you want to use the mailing feature for a multi-wave survey, you actually need the email addresses of the respondents in advance. Eventually, respondents will need to be invited to participate in a subsequent wave of surveys at some point.

However, if participants are recruited through links on a website, social media or via advertising banners, their email addresses are not known in advance. This chapter shows a technical solution where respondents enter their email address in the first questionnaire and this is used to automatically send the invitation to the second questionnaire. To assign the data, pseudonyms are used so that the data set does not contain any personal data.

Position of the Opt-In-Question

The e-mailadress is required via a question of the type Opt-In for mailing list. You should think early on where in the first questionnaire you would like to place this question. Of course, in any case, you should mention early on that this is a survey with multiple questionnaires and that the questionnaire will ask for the email address.

Some respondents do not want to provide their email address (whether due to spam/advertising concerns or privacy considerations) and thus cannot be invited to the second part of the survey.

Asking for the email address very early in the first questionnaire has the following advantages:

  • Participants who categorically do not wish to provide an email address will be excluded from the study right at the start. These participants do not waste time on the first questionnaire.
  • You can work with mailResume() and breaker pages. This allows to collect all data of a participant in one data line. Otherwise, you will receive several data lines for each participant (one per questionnaire).

Asking for the email address by the end of the first questionnaire has the following advantages:

  • You will receive more data records for the first questionnaire – this is useful if you can also utilize the data from the first questionnaire separately.
  • By the end of the first questionnaire, one has already invested some time in participating and has (hopefully) been able to gain some confidence in the researcher's honorable intentions. This makes it more likely that participants will reveal their email address.

Step 1: Create Questionnaires

A total of three questionnaires are required, hereafter referred to as “A1”, “A2” (for the first wave) and “B”. Create them under Compose questionnaire. Which identifiers you actually use for the questionnaires is irrelevant.

  1. The first questionnaire (A1) is used for recruitment, here among other things the e-mail address is requested. Participants fill out this questionnaire immediately after calling up the questionnaire link.
  2. The second questionnaire (A2) is called when participants confirm their e-mail address (double opt-in). So ideally a few minutes after A1. This questionnaire prepares the sending of the invitation mails for the second survey date.
  3. A third questionnaire (B) contains the questions for the second survey wave. If further survey dates are planned, additional questionnaires may be needed (C, D, E, …).

Unter Fragebogen zusammenstellen → Karteireiter Einstellugen legen Sie für die Fragebögen “A2” und “B” bitte den Zugriffsmodus “Serienmail” fest. So ist sichergestellt, dass sich nicht isoliert aufgerufen werden können.

Under Compose questionnaireManage questionnaires please select questionnaire A1 under Standard questionnaire and save this setting (Save button)..

The questions for the first survey time point can be distributed between “A1” and “A2” as desired.

Create a question of type Opt-In for mailing list in the question catalog. Under Privacy in the tab Settings for the question “Pseudonym” must be entered here. At Functionality the default setting should be “Double Opt-In”. You must also enter at least a Subject and a Content of the Confirmation Mail. The latter text must have the wildcard %opt-in%. At this point, the confirmation link is then inserted during the dispatch.

With double opt-in, a confirmation email is first sent to the registered email address. Only when the participant clicks on the link in the confirmation mail, the e-mail address will be added to the mail distribution list (List of Contacts). This ensures that the email address is correct and that a third party does not simply register foreign email addresses for the study.

Then insert the opt-in question at an appropriate place in questionnaire A1.

Note: Later you have to make some changes on the Opt-In-question (s. step 2) so the participants get foreward to the questionnaire A2 after confirming the emailadress.

Step 2: Mailing

Now select Invitation Mailings. There, SoSci Survey may first ask you to agree on a DPA. This is because e-mail addresses are personal data, which enjoy special protection under the GDPR, among other things. You must comply with some information obligations (e.g. in the questionnaire) and you must agree on a DPA before using a subcontractor (e.g. Sosci Survey GmbH) to process such data. If you are unsure, please contact the data protection officer (DPO) at your university, institution or company.

Now please create two mailings under Invitation MailinsMailings.

  1. The mailing no. 1 is only used to call the questionnaire “A2”. It is never actually sent, i.e., the content is not further relevant. However, it is important that the questionnaire “A2” is selected in the Questionnaire URL tab.
  2. The mailing no. 2 is the invitation to the second survey wave. It will be sent delayed and its number (e.g. 2) will be needed later in the PHP code for the function mailSchedule().
  3. If you plan additional survey times, create additional mailings accordingly, one per survey time point. You can also create reminder emails in case participants do not respond to the first invitation email.

Now please open the opt-in question again for editing. Under Detail Settings, tab Response select under Redirect After ConfirmationPersonalized link from now please select the mailing 1. It is convenient that you enter no text for confirmation (Content to show after confirmation) in the opt-in question, then respondents will be redirected directly to questionnaire A2 (what mailing 1 refers to) after confirmation. Save this setting (Save question).

The process so far is as follows:

  1. The participant clicks on the link to the questionnaire (Finding participants) and thus gets to questionnaire A1.
  2. There he answers questions and (sooner or later) enters his e-mail address in the opt-in question.
  3. Once the email address has been entered and the data has been submitted to the server by clicking the “Next” button, SoSci Survey will send a confirmation email to the email address provided.
  4. The participant receives the e-mail and clicks on the confirmation link. This now opens the A2 questionnaire.

Step 3: Automate Mail Delivery

In principle, you could already work with the previous solution. The email addresses are stored in the List of Contacts and you could send the mailing ID 2 manually to send the invitation for the second survey date.

Often, however, the sending of the invitation should be automated. Either at a predefined time or a certain period of time after the call of A2. Therefore A2 PHP code is used in the questionnaire, specifically the command mailSchedule().

On the first page of the A2 questionnaire, insert a “PHP code” element and in it the following command:

mailSchedule(false, 2, 7 * 24 * 3600);

The comand mailSchedule() has three parameters.

  1. The first one specifies the address entry to which the invitation mail should be sent. After our participant has reached the questionnaire A2 through the (individual) confirmation link, SoSci Survey already knows the correct address entry, therefore false is noted here.
  2. The second parameter indicates which mailing should be sent. In the example above, this is the mailing with the ID 2.
  3. The third parameter specifies the time when the emails should be sent. This can be either a time span in seconds or a Unix timestamp. In the example above the timestamp is 7 days (7 times 24 hours á 3600 seconds). Alternatively, you could, for example, enter strtotime('+7 days') as the third parameter, or strtotime('2020-10-31 08:00:00') for a predefined time.

Tip: For testing, enter a small value for the third parameter, e.g. 300 seconds (5 minutes).

Tip: Use disposable email addresses for testing (Chip: Disposable email addresses. If an e-mail address has already been entered via opt-in, no further confirmation e-mails may be sent to this address.

You can test the registration with an e-mail address as often as you like, as long as you delete the address from the address list afterwards (List of Contacts). An email address is blocked for 10 minutes after the opt-in email is sent before another opt-in email can be sent.

Tip: Start the first questionnaire under Compose Questionnaire in debug mode (Start questionnaire in debug mode). Then you can also test outside the survey period defined in the Project Settings.

If you now call up the first questionnaire, enter an e-mail address there and click on the link in the confirmation e-mail, then you can see the new address entry under List of Contacts. And under Invitation MailingsMailings you can also see that the sending of the mailing to an address is prepared.

Multiple Mailings

If you want to send multiple invitations at different times, then simply repeat the mailSchedule() command for each mailing. For example, in the following example, invitations are sent after 7, 14, and 21 days (numbers 2, 3, 4) and one reminder (numbers 5, 6, 7) each on the following day.

// Invitation mails
mailSchedule(false, 2, 7 * 24 * 3600);
mailSchedule(false, 3, 14 * 24 * 3600);
mailSchedule(false, 4, 21 * 24 * 3600);
// Reminder
mailSchedule(false, 5, 8 * 24 * 3600, ['status' => 'no-response']);
mailSchedule(false, 6, 15 * 24 * 3600, ['status' => 'no-response']);
mailSchedule(false, 7, 22 * 24 * 3600, ['status' => 'no-response']);

You create a reminder email in the same way as you create the initial invitation mailing. Then, in the Reminder/Follow-up mail tab, under Reminder/Follow-up mail for, please select the mailing to which you would like to remind the participant.

Note for Respondants

In questionnaire A1, you should point out the following to the participant:

  • Depending on which provider or mail server the subscriber is using, the delivery of the confirmation mail may be delayed – usually 0 to 30 minutes.
  • Sometimes confirmation emails get caught in the spam filter.
  • To continue the survey, it is necessary to click on the confirmation link in the confirmation email. If you are not able to click on the link directly (very rare), you may have to copy it into the address line of your internet browser.

Manual Sending of the Invitations

As an alternative to the automated preparation of sending mailing ID 2, you can also send this mailing manually – mailSchedule() is then omitted and possibly also questionnaire A2.

This procedure is useful if all participants are to complete the questionnaire at approximately the same time. Although the survey period still extends over several days, because not everyone responds to the e-mail immediately – especially in the case of longer recruitment, the data are more comparable in terms of time than with automatic dispatch (where, on the other hand, the time interval between the two survey waves is the same).

  • Addresses are collected for a while – and when there are enough addresses in the List of Contacts, the mailing ID 2 (invitation to questionnaire “B”) is sent to everyone.
  • If the recruitment continues after that, the mailing can be sent again as needed. Participants who have already received the mailing will not receive it again. If further survey waves are to be carried out, additional mailings can be created.


In the dataset, you end up with three rows of data per participant – at least if the participant provided a valid email address and clicked on the links in both emails:

  1. Responses to “A1” – the identifier of the participant is noted here in the variable of the opt-in question.
  2. Responses to “A2” – the identifier is here in the variable SERIAL.
  3. Responses to “B” – the identifier is here again in SERIAL.

If all answers are later to be merged into one data row in the statistical software (MERGE), then it is expedient to use different questions in all three questionnaires, so that the variables get different identifiers. If questions are to be asked in both “A” and “B”, simply copy the appropriate heading.

Data in a Data Row

Instead of using different questionnaires for “A2” and “B”, you can also place the questions in one questionnaire and work with interrupter pages. This has the advantage that the data is stored in one data row in the data set. In addition, filters in part “B” can refer to answers from “A2”. In this case mailResume() is used instead of mailSchedule().

The following example demonstrates the use of mailResume() and mailRevoke() for a survey with three measurement time points, where all data of a participant is stored in the same data row. Possible areas of application are, for example, a course measurement, intervention study or pre/post examinations.


  • Participants automatically receive an invitation to the next measurement point (next questionnaire part) after a certain time and should not have access to the questions of the next questionnaire part before this time has expired.
  • Participants receive automatic reminder emails if they do not respond to the first invitation to the next measurement point within a certain time.


All questionnaire parts are arranged one after the other in one questionnaire. “Mailing / Access URL” is set as the access mode for the questionnaire.

If the email addresses of the participants are not known in advance, a second questionnaire with a question Opt-In for email distribution list is created. For this questionnaire, the access mode is set to “public”.

Create a mailing (in the example ID 1), which should be sent after 7 days as an invitation for the measurement time point 2. In the “Reminders/follow-up mail” tab, under “Type of follow-up mail”, it is set that it is a reminder or a continuation. The wildcard %link% must be used in the text of the e-mail (as usual).

Create two more mailings (in the example ID 2 and 3). These serve as a reminder if the participant has still completed the second questionnaire part after 9 or 11 days (settings as for mailing ID 1).

Create three more mailings (in the example ID 4-6): An invitation to the third part and two reminders (settings as for mailing ID 1).

PHP Code for Time 1

The values (numbers) in the PHP code are to be adjusted according to the respective study, especially time intervals and the mailing IDs.

Between the first and the second part of the questionnaire an additional page is inserted (interrupter page). The interrupter page has the following function:

  • It sends the invitation to the next questionnaire part by means of mailResume().
  • When the participant first accesses the page (at the end of the first part of the questionnaire), it shows a farewell.
  • When the participant accesses the page again (after receiving the invitation to the second questionnaire part) it directly redirects to the next page.

Important: The participant must actually click through to the page on which the PHP code was inserted. Otherwise, no invitation email will be sent. If the last page of the first questionnaire is already a farewell, this page can also serve as a breaker page. In this case, you do not need another page between the two questionnaire parts. But then please note that the goodbye is not “dragged into the page”, but displayed with the text() command in the PHP code. If the text has already been dragged onto the page, remove it from the page before (or after) you insert the PHP code.

When Compose Questionnaire, the following PHP code is placed on the breaker page:

// The time of the first call of the breaker page is stored in variable $timepart1
// isset() and registerVariable() prevent that this time is changed when the page is called again (e.g. reloading the page) and/or that emails are scheduled twice
if (!isset($timepart1)) {
  // sve time
  $timepart1 = time();
  // Send invitation mailing with ID 1 at the second measurement point after 7 days
  // The time interval is given in seconds: 7 x 24 x 3600 seconds = 7 days
  mailResume(false, 1, 7 * 24 * 3600);
  // Send first reminder mail with mailing ID 2 after 9 days
  // (i.e. two days after the first invitation to the second measurement point).
  mailResume(false, 2, 9 * 24 * 3600);
  // Send second reminder mail with mailing ID 3 after 11 days
  // (i.e. four days after the first invitation)
  mailResume(false, 3, 11 * 24 * 3600);
// Check how much time has passed since the page was first accessed
if ((time() - $timepart1) < 7 * 24 * 3600) {
  // Show breaker page if it is less than 7 days,
  // so that participants cannot see the questions of the second measurement time point earlier.
  option('resume', true); // No indication that the interview will be continued
  option('nextbutton', false); // Hide next button (pause interview)
  text('ende1');  // Possibly show a farewell to the first questionnaire part
} else {
  // If the participant has returned after 7 days and thus the current time minus the new time variable
  // is greater than 7 days, then the survey continues on the next page

PHP Code for Time 2

Between the second and third questionnaire part a breaker page is placed again or alternatively on the last page of the second questionnaire part. The PHP code is largely the same as the code above. However, mailRevoke() ensures that any outstanding reminders (mailings ID 2 and 3) are no longer sent.

// New time variable for the second time point
if (!isset($timepart2)) {
  $timepart2 = time();
  // Delete reminders if they are still pending
  mailRevoke(false, 2);
  mailRevoke(false, 3);
  // Send invitation to third measurement point with mailing ID 4 after 7 days
  mailResume(false, 4, 7 * 24 * 3600);
  // First reminder after 9 days
  mailResume(false, 5, 9 * 24 * 3600);
  // Second reminder after 11 days
  mailResume(false, 6, 11 * 24 * 3600);
// Interruption for 7 days
if ((time() - $timepart2) < 7 * 24 * 3600) {
  option('resume', true);
  option('nextbutton', false);
} else {

PHP Code for Time 3

On the third to last page of the questionnaire, any outstanding reminder emails still need to be deleted.

  mailRevoke(false, 5);
  mailRevoke(false, 6);      


Important: Do not place any questions on the breaker pages – the PHP code above only provides for text (thank you, goodbye, and hint for the next measurement point).

Note: The invitation to the third questionnaire part takes place relatively at the time when the participant has accepted the invitation to part 2. So if he completes Part 2 only 10 days after Part 1, then the invitation to Part 3 will not be sent until 17 days after Part 1 is completed. Alternatively, you could schedule all (!) invitations and reminders right at the end of Part 1. The filter at the end of part 2 should then refer to $timepart1 instead of $timepart2.

Note: In the List of Contacts, the participation status for the continuation and reminder mailings not is visible (gray marking for the mailings). The participation status is only displayed for a possible opt-in mailing. However, in order to track the participation status, one can look at the data already collected. An individual assignment based on the SERIAL variable is, however, only possible if the e-mail address was imported with the “Personalized entry” setting for “Anonymity”.

Tip: You can use the same reminders multiple times (with a general reminder text). In the above example, you could send mailing ID 2 for all reminders (so instead of mailings ID 3, 4 and 5).

en/survey/opt-in-live.txt · Last modified: 23.05.2024 08:40 by admin
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki