How to resume a non-unique "StartSurvey" interview
See attached 5.5.3 QEX.
See 5.5.3 testing link: https://demo.askia.com/WebProd/cgi-bin/askiaext.dll?Action=StartSurvey&SurveyName=MB_ContinueStartSurveyInterviews
Why? What's the purpose?
In Askia, we allow you to use non-unique "StartSurvey" links to invite respondents into your surveys. The idea is to use this link on Social Media sites (Facebook, Twitter, etc.), blog posts, or monthly newsletters. Anyone who clicks the link will have a unique interview generated without needing any unique panel information from that respondent beforehand.
The problem is when the respondent wants to resume their "StartSurvey" interview. If they close their tab/browser and go back to your Social Media post and re-click the "StartSurvey" link, a NEW interview will be generated by WebProd rather than resume the previously started interview. This is by design, as the "StartSurvey" link does not contain any unique respondent panel information.
Below we'll outline a few solutions you could implement to send an email to the respondent which lets them resume their "StartSurvey" interview.
Easiest solution:
Enable the use of "Cookies" within your surveys. See this article to learn more: https://support.askia.com/hc/en-us/articles/360008080897-Using-Cookies-with-AskiaDesign
"Cookies" allow your respondents to click the original "StartSurvey" link and resume the interview where they left off (albeit with a few caveats - please read the above article to get a full overview).
Solution for AskiaField 5.5.3 and above:
Display a button on every screen within the survey that the respondents can click.
When the respondents click this button, they will be forwarded to a section of the survey (in this case, a "MyMail" variable) that will ask them for their email address.
After they input their email address, a "Send email routing" action occurs, sending them an email with the link to their specific interview, returning them to the last screen they answered.
This is possible in 5.5.3+ due to the following new scripting keyword and actions:
- After > {All Questions} > Always
- CurrentQuestion.Shortcut
- CurrentQuestion.GotoURL()
- Interview.SetPosition()
Additionally, in 5.5.3, we now re-allow access to the "Before Content" and "After Content" sections in "Options > Internet Settings".
Steps:
- Step 1: create the following five variables required for this to work:
Step 2: nest them under some chapter at the very end of the survey - in my case, this is my "Ending" chapter. - Step 3: create all of the necessary routings for this to work (please refer to the attached 5.5.3 QEX to use as a reference):
1) After > {All Questions} > Untick "Even when skipped" > Run an Askia Script:Dim MyMailVariableName = "MyMail"
Dim MyVerificationVariableName = "Verification"
If (CurrentQuestion.HasAnswered AND CurrentQuestion.Shortcut <> MyVerificationVariableName AND CurrentQuestion.Shortcut <> MyMailVariableName) Then
LastQuestion.SetValue(CurrentQuestion.Shortcut)
LastPosition.SetValue(CurrentQuestion.GotoURL())
EndIf
This routing runs after every screen and sets the value to our "LastQuestion" and "LastPostition" variables, only if we are not currently on those screens.
2) After > {All Questions} > Tick "Even when skipped" > Run an AskiaScript:
Dim MyString = ""
MyString = MyString + LastPosition.Value
MyString = MyString + "&Shortcut="
MyString = MyString + LastQuestion.Value
MyURL.Setvalue(MyString)
This routing builds the "MyURL" variable which holds the full "GoTo" URL to this respondent's unique interview.
3) After > Ending > Always > Do not ask > MyMail.
4) After > Verification > Always > Untick "Even when skipped" > Run an AskiaScript:
Dim MyString = ""
MyString = LastQuestion.Value
Interview.SetPosition(Survey.Questions.FindByShortcut(MyString))
Those are the main pieces of routing.
The other two are there for sending the email and executing email verification with a blocking message. - Step 4: go to "Options > Internet Settings > Contents tab > After contents > paste the following script:
<br><br>
{%
Dim arrChapters = Survey.Questions.FilterByTag("GoToChapter")
Dim strRes = ""
Dim i = 0
For i = 1 To arrChapters.Count
strRes = strRes + "<a class='btn primary keyframe' href='" + arrChapters[i].GotoURL()+"&Shortcut=" + arrChapters[i].Shortcut + "'>" + "Continue later.." + "</a></br>"
Next
%}
{%:= strRes %}
The above script is for the "Continue later.." button. For simplicity, I've styled it using the CSS Class "btn primary keyframe", which is part of all of our ADPs. You can style it however you like.
That's it.
Once you've implemented the variables, the routing, and the "After content" script, you should get something that looks like this:
The "Continue later.." button can be shown or hidden on any screen you'd like by editing each screen's properties manually (Screen Mode > Screens > Right-Click on Screen > Properties > Content tab > After content > untick "Use default" and leave it blank).
Any time it's clicked, the respondents are forwarded to the "MyMail" variable where they're asked to insert their email. If it's a valid email address, the "Send email" routing triggers and sends them an email. Then their interview is forwarded to the "Verification" chapter where they can choose to either continue by clicking "Next" or close their browser window and resume later by clicking the link that was sent to them.
Below is a moving GIF demonstrating how this works in AskiaDesign:
Solution for AskiaField 5.4.9 and below:
Please reach out to Askia Support (support@askia.com) if you're running 5.4.9 AskiaField and would like a solution. As we no longer support 5.4.9, it would be better to reach out to our team for assistance upgrading your AskiaField installations to the latest field versions and then using the above 5.5.3+ method instead.
Without going into too much detail, this 5.4.9 method uses jQuery to pipe in the "Intvw" and "Survey" HTML input values in our "FormAskia" into hidden open-ended variables. You'll then manually rebuild the respondent's "DoInterview" link via AskiaScript routing, and then send them an email via the "Send email" routing action.
<script>
var varIntvw = $('input[name="Intvw"]').val().toString();
var varSurvey = $('input[name="Survey"]').val().toString();
$('input[id="MyIntvw"]').val( varIntvw );
$('textarea[id="MyIntvw"]').val( varIntvw );
$('input[id="MySurvey"]').val( varSurvey );
$('textarea[id="MySurvey"]').val( varSurvey );
</script>
Not as elegant as the 5.5.3 method.
See attached 5.4.9 QEX.
See 5.4.9 testing link: https://losangeles.askia.com/WebProd/cgi-bin/askiaext.dll?Action=StartSurvey&SurveyName=MB_ContinueStartSurveyInterviews_549
If you have any questions with any of the above, please reach out to Askia Support (support@askia.com).