Skip to main content

FV Kinesis Support

All the topics, resources needed for FV Kinesis.

 
FocusVision Knowledge Base

Profile Controller Example

This section will show you how to create a router that will forward your respondents to a followup survey.

In our example, we will have a two question setup that determines which survey our respondents will be routed to. Our condition for this will be based on QCHOOSE, a radio question, and we will generate our exit code with a computational, QEXIT, according to the respondent's selection.

SURVEY EDITOR


Your computational will need to have conditional statements that generate your exit link's code based off of QCHOOSE's response.

The following PHP can be used as a template where you will only need to update the question labels to reflect your own and also your "window.location.href" destination (i.e. https://www.yourdomain.com/survey/?ID=12). If you haven't created your followup surveys yet, you can use the example code below for now and simply return with the survey IDs later.

By default, there is a delay of 1500ms before the redirect will occur. You can either modify this time to a custom delay or remove it altogether by setting it to 0.

 
// You can create as many redirects as you'd like here.

// Route 1 redirect
if($Qchoose == 1) {
   return "
	<script type='text/javascript'>
		$(function(){
			setTimeout(function(){
				// This URL can be any web address, whether relative or absolute (i.e. https://www.google.com)
				window.location.href = '/survey/?ID=321';
			},1500);
		});
	</script>
   ";
}

// Route 2 redirect
if($Qchoose == 2) {
   return "
	<script type='text/javascript'>
		$(function(){
			setTimeout(function(){
				// This URL can be any web address, whether relative or absolute (i.e. https://www.google.com)
				window.location.href = '/survey/?ID=321';
			},1500);
		});
	</script>
   ";
}

else return false;
 

INFO PAGE MANAGER


We will need to modify our default 'Thank You' landing page to include routing code that we generated in our QEXIT computational.

When editing your info page, you will need to include your routing script by piping in ~QEXIT~. Your HTML should look similar to the following:

<table style="width: 100%;" border="0">
<tbody>
<tr>
<td>
<div><img src="image/infothankyou.gif" alt="Thank You"></div>
</td>
</tr>
<tr>
<td class="surveyarea">
<div style="text-align: center;">Thank you for your responses!</div>
<div style="text-align: center;">You are now being sent to <strong>~Qchoose~</strong>!</div>
<div style="text-align: center;">~Qexit~<br><br><br><br></div>
</td>
</tr>
</tbody>
</table>

Congratulations! We have completed our controller exercise!

VIEW DEMO

  • Was this article helpful?