Skip to main content

Decipher Support

All the topics, resources needed for Decipher.


FocusVision Knowledge Base

Setting Up Toluna Encrypted Redirect Links

This document provides details on how to setup encrypted redirect links for the Toluna sample source.

The Toluna sample requires the use of a Python function which needs special variables and redirect links to ensure the quality of data collected. To setup encrypted redirect links for a Toluna sample, follow these steps:

Step 1:  Create a new Toluna project or access an existing project.

Step 2:  Open the project in Builder and add a new Custom Sample Source.

To do this, first, click "Sample Source" in the question tree and then click "Add New Sample Source." 

In the Sample Sources window, select an existing custom sample source (pre-programmed) from the sample sources library and click Insert. 

Click "Yes, remove open sample."

Step 3:  Copy the Toluna Sample Source template into the survey.xml.

Copy the template (provided below) to the location in the survey.xml where the sample sources are deployed. 

      <samplesource list="1">
             <title>Custom Sample Source</title>
             <var name="gid" unique="1"/>

             <exit cond="terminated"
             /mscui/SOTerminated.aspx?sname=XXXX&amp;gid=%s&amp;' % gid, 

             <exit cond="overquota"
             /mscui/SOQuotafull.aspx?sname=XXXX&amp;gid=%s&amp;' % gid, 

             <exit cond="qualified"
             /SOQualified.aspx?sname=XXXX&amp;gid=%s&amp;' % gid, 'YYYY')}"/>

In the next steps, you modify this template to implement the Toluna encryption.

Learn more:  Configuring Sample Sources

Step 4:  Update the Redirect URLS

To set up the encrypted Toluna Redirect links, you need to update the sname and secret key variables in the template URLs.  

  • Sname: Represents the name of the study.  Toluna provides the study name and is created on a per-project basis
  • Secret Key:  The secret key is the unique identifying number for respondents entering the survey.  Toluna provides the secret key.

To update the variables in the URLs, replace:

  • 'XXXX' with the Toluna provided sname.
  • 'YYYY' with the Toluna provided secret key. Be sure to place the secret key between the single quotes (' ') and do not delete them.

You make these replacements for XXXX and YYYY in the terminated, overquota, and qualified redirect URLS. 

For example, for the below redirect link, the XXXX and YYYY variable placeholders have been bolded for your convenience to show you where to look for them in the template:;gid=%s&amp;' % gid, 'YYYY'

Step 5:  Test the Survey

From the Test menu, select "Test Survey."  In the survey test environment, give the sample source variables any dummy value like shown below and then click "Show Survey with Tools."

Step 6:  Verify unique values for each completion status.

Verify that the “TolunaEnc” and SO (SOTerminated, SOQuotafull or SOQualified) values are unique for each type of completion status (Terminated, Overquota, and Qualified) as shown below.

Qualified Status


Overquota Status


Terminated Status


Encrypted redirect links for the Toluna sample source are now complete.

  • Was this article helpful?