Many surveys rely on outside panels to gather interviews. Respondents originating from panels generally need to be redirected to that panel's domain after completing (or being terminated from) the survey. Auto Redirect is a system which streamlines the process of redirecting respondents with finishing statuses to the appropriate web pages. This system is intended to make routing respondents to the appropriate places easier than ever.
Auto Redirect is a multi-part system comprised of the following:
- A sheet which contains all panel and their respective redirects
- A source code tag which establishes the relationship between the survey and the sheet
- Automatically generated variables that record information about the redirect for each respondent
- A URL parameter appended to the live survey URL to specify the record's corresponding panel.
Sheet
The Auto Redirect sheet is organized by panel/source provider. Each provider is a separate row, and each row has columns for each finishing status. These cells contain the appropriate redirect URL for that sample provider for the given status. Arbitrary data may be added, but for the sheet to be valid the 'id' and 'panel' columns are required. Status columns may be added as needed, although at the minimum, Complete, Terminated, and Over-quota statuses should be present. Each status column is prefixed "status_" followed by the status letter ID.
id | panel | status_C | status_T | status_Q |
---|---|---|---|---|
numeric ID | Panel Name | Completed redirect | Terminated redirect | Over-quota redirect |
... | ... | ... | ... | ... |
Redirect link formatting
Many panels require that custom data be appended to URL parameters. Sometimes, this data is of a variable nature. Survey variables, as well as Perl conditionals, are valid syntax in the redirect sheet.
Survey variable reference
Survey variables can be directly referenced:
https://www.somepanelprovider.com?custom_param=$QSURVEY_FIELD
Perl conditional
Perl conditionals are valid inside of Perl code blocks:
https://www.somepanelprovider.com?custom_param=[* if ($Q1 == 1) {'A'} else {'B'} *]
Passing data from invite link
Some panel providers might have a value that is provided in the invite link, but is not captured by any survey fields and does not change for a given study for the given finishing status. Such values may be referenced by prepending $pan_
to the parameter name as defined by the entry URL.
# Given an entry link https://www.mysurveydomain.com/pub/mysurveyid?panelid=101&custom_param=1001 # Redirect link which always passes parameter 'custom_param' with value '1001' https://www.somepanelprovider.com?custom_parameter=$pan_custom_param
Syntax
To invoke auto-redirection for a given survey, use the autoredirect
tag on the app config
widget.
# Basic appconfig autoredirect: survey_id.sheet_id # Slice appconfig autoredirect: survey_id.sheet_id [1,5,10]
Most likely, redirect sheets are a system resource, and would therefore be referenced with system.sheet_id
syntax. For more information about referencing sheets, see Using spreadsheets in survey programming.
Use slice syntax to specify only those panel providers the survey uses, particularly if the Auto Redirect sheet is very long. Also, note that the slice syntax above could utilize exclusions (e.g. -[1,5,10]
) rather than inclusions.
Variables
Auto Redirect creates the following variables in the survey dataset.
Variable | Description |
---|---|
panel |
The record's panel, as specified by the 'panelid' URL parameter. |
final_redirect |
The record's end-of-survey redirect URL. |
URL parameter
The URL parameter 'panelid' must be appended to the survey URL to invoke the associated redirects.
Link format:
https://www.mysurveydomain/com/pub/mysurveyid?panelid=1
As with any other URL parameter, it may be chained with an ampersand ('&') character to other URL parameters.
Interaction with 'end survey' widget
The endsurvey
widget may coexist with Auto Redirect. In the case that endsurvey
has a redirect, it will override Auto Redirect.
Creating your own redirect sheet
To edit an existing panel's redirects, download and edit the system sheet for panel redirect and upload locally to your survey. Then, in your survey's source code, change the autoredirect
reference from the system sheet to the local redirect sheet you uploaded.
Comments
0 comments
Please sign in to leave a comment.