Change your Snap WebHost questions dynamically according to how people arrive at your questionnaire
Last month's worksheet explained how to use the same survey to collect data about different products or from different groups of people and tailor it accordingly.
This month's worksheet explains how to take this further using Snap Online WebHost. When a respondent clicks the link to the Snap Online WebHost survey, it identifies the survey site as before and you can then use this information to set up a derived variable that inserts dynamic text in your questions.
As before, it assumes that you are running a website satisfaction survey on three different sites, each of which represents a different branch of your organisation.
Background
If you are running a survey on the Web you can load information into the system variables when a user clicks on a link to a survey. This is used when respondents are logged in automatically (see worksheet 34). One of the paradata variables available is called ID.site. You can load text into this field by defining a special link in a web page, or by putting it in your email invitations.
If you are hosting your survey in Snap Online WebHost you can change the text of the questions by inserting derived variables containing different question text which is selected according to the contents of the site variable.
Summary of steps
This worksheet assumes that you are using a survey identical to that created according to the worksheet 46 instructions. The ID.site variable will load with a value of 1, 2 or 3 depending on the link that the user clicked on.
You will create a new derived variable based on the information in the ID.site variable and insert this variable into the question text, so that it is appropriate to the respondent.
Step 1: Creating a version of the survey for Snap Online WebHost
Open the created survey. It must have the ID.site paradata variable included in the survey. If you are using the one created according to worksheet 42, it will only have HTML output, so you will need to add a Snap Online WebHost edition.
- Click the
button to open the Editions and Templates window. - Click [New] to open the New Survey Edition dialog.
- Set the Publication Medium to Web and Snap Online and click [OK].
- Click [OK] to close the Editions and Templates window.
The new Snap Online WebHost survey will look identical to the previous HTML one with the ID.site variable included but hidden. You will need to display it.
- Select the ID.site variable in the questionnaire.
- Select Show from the toolbar topics list.

- Select All in what is to be shown and check the box.
For the worksheet, it's assumed that the ID.site variable will be loaded with 1 from the Product site, 2 from the Training site and 3 from the Service site.
Step 3: Using the derived variable to create dynamic text
- Place your cursor in the question between "the" and "website".
- Right-click and select Insert|Variable Field from the context menu, (or select Font in the toolbar topics list, click [Insert] on the questionnaire window ribbon and select Variable Field from the list)
- The New Variable Field dialog appears. Select V1 in the variable list.

- Set Aspect to Reply (this means that the response will be used) and click [OK]. The variable will appear within the question,

Step 2: Adding a derived variable to use in the question
You can create a derived variable which will hold different text, depending whether the value in ID.site is 1, 2 or 3.
- Click
to open the variables window. - Click
to add a new variable. Label the variable as Site text for insertion. - Set the type to Derived and the Response to Single.
- Set the required values for your variable
- Double click in the Label column, and add a code label of Company product
- Use the Tab key to move across to the Values column.
- Set the value to be ID.site=1.

- Tab again for the next label and set it to Company development. Set the value to ID.site=2.
- Repeat for Company services and ID.site=3.
- Click
to save the variable.
Step 4: Testing the dynamic text in a preview
It is worth checking that the dynamic text substitution works in a preview when you hand-edit the data, before setting up the survey so that you cannot enter the site data by hand.
- Select File|Publish to open the Publish Questionnaire dialog.
- Select the Output Method to Preview Only.
- Click [Publish] to publish the survey. A preview of your survey will appear, showing the site variable in a page on its own.

- Enter
2in the ID.site variable and click [Next]. Check that the correct text appears in the question.
- Click [Back] to return to the ID.site variable page. Repeat the test, entering first
1and then3in the site variable. - When you have finished your check, close the preview. If there were any problems, check the definition of the derived variable in the survey.
Step 5: Hiding the paradata variable
- Click anywhere in the ID.site variable to select it.

- Select Show in the Topic Objects list and select All in the next list.
Uncheck the Show box. The ID.site question disappears.
Step 6: Testing your survey
Because the site variable is hidden in the published survey, you need to use the special links to test that the finished survey works correctly. You can only do this once your survey has been loaded onto Snap Online WebHost so you know what its link will be.
- Press [Ctrl]+[Shift]+[W] or select File|Publish to open the Publish Questionnaire dialog.
- Set the Output Method to Publish without preview.
- Click [Publish] to publish the survey.
- Upload the survey to Snap Online WebHost. Your survey will be added to the list of surveys.
- Click the survey name to go to the Summary page for that survey. A link is shown for the test. This is an abbreviation of the full link, so you cannot use it directly.

- Right-click on the survey name. Select Copy Link Location from the context menu.
- Open a new browser window or tab, and paste the link into the address field. Edit the link in the address bar of the browser by adding &s=1 to the end of the survey link.
e.g., https://snaponline.snapsurveys.com/siam/surveylanding/surveypreview.asp?k=123296342905&
s=1 - Click [Enter] to go to that address and check that the correct text appears in the question.
- Repeat for the other two variations, changing the extra link text to &s=2, and &s=3.
Your survey is now ready to run. You can set up the links on the different web pages by copying the link location of the survey and adding the appropriate site string.