LogoLogo
  • Documentation
  • PRODUCT REFERENCE
    • Introduction
    • Concepts and Terminology
      • Console
      • Servers (X Agents)
      • Projects
      • Configurations
      • Rules Editor
      • Rules, rule catalogue, protocol rules and rule sets
      • Test Data
      • Trace Data
      • Flight Recorders
      • Case Managers
      • Data Files
      • Content Files
      • Performance Data
      • Extensions
      • Protocols
      • Credential Vault
      • Custom Functions
      • Databases
      • Input Adaptors
      • Users
      • User Roles
      • Access Rules
      • Repositories
      • Audit Log
      • Proxies
    • Architectural Scenarios
      • Command and Control
      • Simplest Form
      • Servlet Filter
      • API Transformation
      • Active Web Proxy
      • Web Application Server
      • Active Proxy With Content
      • Mobile Application Server
      • Asynchronous Multi-Protocol
      • Data Loss Prevention Architecture
    • Getting Started
      • Login
      • Essential Things to do First
      • Keeping the Product Current
      • Common Console Management Tasks
      • Viewing Active Servers
    • Quick Product Introduction
      • Preparing the Browser Proxy
      • Setting up the Proxy in the Browser
      • Verifying the Browser Configuration
      • Understanding the Configuration
      • Understanding input and variables
      • Preparing a new repository
      • Locating the Page to Modify
      • Determining the Actions Required
      • Building the First Rule Set
      • Setting Rule Properties
      • Connecting up the First Rule
      • Getting a Server Result
      • Manipulating the Server Result
      • Returning the Result to the User
      • Creating a Configuration for the Rule Set
      • Selecting the Input Source
      • Deploying the New Configuration
      • Testing the Rules
    • X Agent details
      • Configuration Settings
      • Rule Sets
      • Tips and Techniques for Working with the Rules Editor
      • Web Application Rule Set Patterns
      • Building Rule Sets for Inclusion
      • Notes on Working with SOAP
      • Zero Installation Rules Testing
    • Data Files
    • Content Files
      • Previewing Content Files
      • Editing Content Files
      • Deploying Content Files
    • Test Data
      • Uploading and Downloading Test Data
    • Performance Data
      • Setting the Performance Collection Level
      • Retrieving the Performance Data
      • Viewing Transaction Counts
      • Viewing Transaction Counts and Inline Time
      • Viewing the Complete Performance Report
      • Understanding the URI Performance Information
      • Performance Benchmarks
    • Trace Data
      • Understanding the Trace
    • Tracing the Result of a System Failure
    • Conjoined Performance and Trace data
    • Live Performance Data and Probes
      • Setting Probes
      • Live Performance Impact Considerations
    • Accessing Server Logs
      • Viewing a log
    • Working with Flight Recorders
      • Searching Flight Recorder Information
      • Retrieving Flight Recorder Data
      • Graphing Flight Recorder Data
    • Working with Case Managers
      • Case Manager Definitions
      • Navigating the Case Managers
      • Creating a Case From Rules
      • Creating a Case From the Console
      • Viewing the Queues
      • Picking a Task
      • Case View
      • Completing a Task
      • Task History
      • Searching Tasks
      • Searching Cases
    • Managing Repositories
      • Moving Files Between Repositories
      • Copying Configurations and Rule Sets Together
      • Copying Dependent Rule Sets
      • Backing up
      • Moving Entire Repositories Between Consoles
      • Setting Repository Imports
      • Specifying Repository Rule Group Restrictions
    • Version Control and Restoring Files
    • Using the Portal UI
      • Using the Start Menu
      • Positioning Windows
      • Resizing Windows
      • Maximize, Restore and Minimize
      • Storing and Switching Desktops
    • Enterprise Level Projects
      • Creating a Project
      • Working with Tasks
      • Closing a Task
      • Closing a Project
      • Project Assistants and Work Output
    • Administration Functions
      • Extensions
      • Custom Function Setup
      • Setting up a Database
      • Input Adaptors
      • Credential Vault
      • Log Adaptors
      • Server Definitions
      • Managing Large Clusters
      • Setting up the Flight Recorder in the Console
      • Creating a Case Manager Definition
      • Work Output
      • Project Definition
      • Managing Users
      • Managing User Roles
      • Managing Access Rules
      • Authenticating via LDAP
      • Authenticating via SAML
      • Audit Log
    • Installation and Configuration
      • Installing on macOS
      • Installing on Red Hat Enterprise Linux
      • Installing on Windows - Quick Start
      • System Requirements
      • Server Installation
      • Understanding the Console Deployment Structure
      • Console Server Type Configuration
      • Console Server Configuration
      • Removing Other Unnecessary Components
      • Installing Inline with an Existing Application
      • Installing a Stand-alone Multi-Protocol Feed Server
      • Installing a Stand-alone Built in Forwarding Proxy
      • Creating a Cluster Slave Console Instance
      • Understanding the magic.properties Configuration Settings
      • Port Numbers and how to Change Them
      • Dealing with Internal Failures
      • Linking Multiple Applications Together into a Single Server
      • Monitoring by External Systems
      • Installation Considerations for Portals
      • Docker Configuration Guide
      • AWS User Deployment Guide
      • Google Cloud User Deployment Guide
    • Creating a Stand-alone Built in Forwarding Proxy
      • Installing with Ubuntu and mySQL
    • Setting up a DNS override for Data Loss Prevention
      • Deciding what to Override
      • Installing a DNS Server for the Overrides
      • Setting the Override
      • SSL Considerations
    • Backup and Restore
      • The Server Component
      • The Console Component
    • Third Party Software
      • Open Source Components
      • Closed Source Licensed Components
      • Licenses
  • PROGRAMMER'S GUIDE
    • Composable Agentic Platform Concepts
    • Setting up a Development Environment
    • Creating a Rule
    • The Kapow Extension - Example
    • Java Documentation
  • CONSOLE WIZARDS
    • Create REST with JSON service
    • Create JDBC database definitions
    • Create data set maintenance custom function
  • BEST PRACTICES
    • Naming Conventions
    • Comments & Descriptions
    • Application Configuration
    • Rules & Rule Sets
    • Repositories
    • Data Manipulation
    • Internationalization
    • Debugging
    • Performance Testing
    • Tag Replacement Techniques
    • Best Practices Repository
  • GUIDES
    • Hello, World!
    • TCL Script Writer Reference
    • Windows Automation Reference
    • Browser Certificate Installation Guide
    • Web Development Guide
    • Using the Push Notification Framework
    • Raspberry Pi with PiFace Reference
    • TomorrowX Portal User Guide
    • Examples
      • CSRF attack prevention
      • Two Factor Authentication
      • Frame Busting
      • Google Analytics
      • DNS Multi Protocol
      • Customer Satisfaction Survey
  • CHANGE HISTORY
    • New in Version 8
    • New in Version 7
    • New in Version 6
    • New in Version 5
    • New In Version 3.1
    • New In Version 3.0
  • 🌏TIME ZONES
  • ❓TROUBLESHOOTING
    • DB2 SQL error: SQLCODE: -443
    • Error 404 when trying to access the console
    • java.io.IOException: Too many open files
    • Accidental deploy to console server
  • ⚙️BROWSE COMPONENTS
  • EULSA
Powered by GitBook
On this page
  • Planning the rules
  • Getting started
  • Designing the user interface elements
  • Creating the survey selection rules
  • Creating the survey load rules
  • Creating the survey rules
  • Creating the survey configuration
  • Testing
  • Setting up the flight recorder definitions
  • Seeing the survey results
  • Potential improvements
Export as PDF
  1. GUIDES
  2. Examples

Customer Satisfaction Survey

This case study will show you how to inject a random customer satisfaction survey into the user experience on a site.

We will use a flight recorder to graph the responses and collate comments from the users.

Planning the rules

The first step in implementing our customer satisfaction survey is to create a plan of what we intend to do, and how we wish to go about it. It is often a good idea to write this down in plain English and then use that text as a guide whilst designing the rule structure. In this case, the plan reads like this:

  1. We want to ask random customers about their experience with our site.

  2. We want to have the survey appear on our main page after log-in.

  3. We want to make the survey experience as quick and painless as possible to get the maximum potential responses.

  4. We are going to use the Tomorrow Software flight recorder feature to graph and view the responses.

Getting started

In this case study we are going to split the decision points into three discrete components, following the recommendations mentioned elsewhere in this manual. So, start by adding a new repository called "Customer survey" and create three blank rule sets:

  1. "SurveyLoad", which is the rule set that will pre-check our survey and make sure all of the data we need is collected before we start the survey process.

  2. "SurveySelection", which is the rule set that will determine if a user is selected for a survey.

  3. "Survey", which is the rule set that will contain the survey logic itself.

Designing the user interface elements

The plan involves injecting a customer survey on top of the user experience. We can do this as a pop-up window or we can simply overlay it on top of the site using JavaScript. Given that most users block pop-ups these days by default, the later seems like the better option. We want to keep the survey itself as pure HTML, so a little bit of basic JavaScript will take care of it:

<script>
var tbody = document.getElementsByTagName("body")[0];
var tnode = document.createElement('div');
tnode.style.position='absolute';
tnode.style.top='0px';
tnode.style.left='0px';
tnode.style.overflow='hidden';
tnode.style.display='none';
if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {
var pageWidth = document.body.scrollWidth+'px';
var pageHeight = document.body.scrollHeight+'px';
} else if( document.body.offsetWidth ) {
var pageWidth = document.body.offsetWidth+'px';
var pageHeight = document.body.offsetHeight+'px';
} else {
var pageWidth='100%';
var pageHeight='100%';
}
tnode.style.opacity=0.4;
tnode.style.MozOpacity=0.4;
tnode.style.filter='alpha(opacity=40)';
tnode.style.zIndex=1000;
tnode.style.backgroundColor='black';
tnode.style.width= pageWidth;
tnode.style.height= pageHeight;
if (parseInt(tnode.style.height)<700) tnode.style.height='700px';
var ctrNode = document.createElement('div');
ctrNode.style.position='absolute';
ctrNode.style.top='10%';
ctrNode.style.left=parseInt((parseInt(pageWidth)-500)/2)+'px';
ctrNode.style.backgroundColor='white';
ctrNode.style.zIndex = 1001;
ctrNode.style.width='500px';
ctrNode.style.height='500px';
ctrNode.innerHTML = '<iframe width="100%" height="100%" name="survey" src="survey.html"><\/iframe>';
tbody.appendChild(ctrNode);
tbody.appendChild(tnode);
tnode.style.display='block';
</script>

You can copy and paste the above JavaScript code into a file named "showsurvey.js" and upload it to the "Data Files" section of the "Customer survey" repository.

The above JavaScript will essentially grey out the application itself and overlay a HTML file on top that is named "survey.html".

Now we need to create the survey HTML itself. Once again this involves basic web design skills. The end goal is a page that looks something like this:

The easiest way to create the HTML is to follow these steps:

  1. Create a subfolder under the "Content Files" section of the "Customer Survey" called "Qwerty".

  2. Add a new file under the "Qwerty" folder named "survey.html".

  3. Copy the following HTML code to your clipboard:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Untitled document</title>
</head>
<body>
<!--CTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt--><!--CTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt-->
<p>Dear customer,</p>
<p>You have been randomly selected to take part in a very short customer satisfaction survey. We value your time, so if you participate we will place you in a draw to</p>
<h1>WIN a brand new uPod Feel</h1>
<p>Simply answer the 4 questions below and you will automatically be placed in the draw. All questions must be answered to be able to enter.</p>
<div style="text-align: justify;"><form action="/qwerty/survey.jsp" method="post" enctype="application/x-www-form-urlencoded" accept-charset="UNKNOWN">
<p><input name="Cancel" type="submit" value="No Thanks" /></p>
<hr />
<p>Please answer the following questions with a rating from 1 to 5, where 1 equals "Strongly disagree" and 5 equals "Strongly Agree":</p>
<p>I use your site because of the great product range</p>
<table border="0">
<tbody>
<tr>
<td width="20%">Strongly disagree</td>
<td width="20%">&nbsp;</td>
<td width="20%">Neutral</td>
<td width="20%">&nbsp;</td>
<td width="20%">Strongly Agree</td>
</tr>
<tr>
<td><input name="ProductRange" type="radio" value="Strongly disagree" /></td>
<td><input name="ProductRange" type="radio" value="Somewhat disagree" /></td>
<td><input name="ProductRange" type="radio" value="Neutral" /></td>
<td><input name="ProductRange" type="radio" value="Somewhat Agree" /></td>
<td><input name="ProductRange" type="radio" value="Strongly Agree" /></td>
</tr>
</tbody>
</table>
<p>I use your site because of the excellent pricing</p>
<table border="0">
<tbody>
<tr>
<td width="20%">Strongly disagree</td>
<td width="20%">&nbsp;</td>
<td width="20%">Neutral</td>
<td width="20%">&nbsp;</td>
<td width="20%">Strongly Agree</td>
</tr>
<tr>
<td><input name="Pricing" type="radio" value="Strongly disagree" /></td>
<td><input name="Pricing" type="radio" value="Somewhat disagree" /></td>
<td><input name="Pricing" type="radio" value="Neutral" /></td>
<td><input name="Pricing" type="radio" value="Somewhat Agree" /></td>
<td><input name="Pricing" type="radio" value="Strongly Agree" /></td>
</tr>
</tbody>
</table>
<p>I find the site easy to use</p>
<table border="0">
<tbody>
<tr>
<td width="20%">Strongly disagree</td>
<td width="20%">&nbsp;</td>
<td width="20%">Neutral</td>
<td width="20%">&nbsp;</td>
<td width="20%">Strongly Agree</td>
</tr>
<tr>
<td><input name="EaseOfUse" type="radio" value="Strongly disagree" /></td>
<td><input name="EaseOfUse" type="radio" value="Somewhat disagree" /></td>
<td><input name="EaseOfUse" type="radio" value="Neutral" /></td>
<td><input name="EaseOfUse" type="radio" value="Somewhat Agree" /></td>
<td><input name="EaseOfUse" type="radio" value="Strongly Agree" /></td>
</tr>
</tbody>
</table>
<p>I use your site because of the fast delivery</p>
<table border="0">
<tbody>
<tr>
<td width="20%">Strongly disagree</td>
<td width="20%">&nbsp;</td>
<td width="20%">Neutral</td>
<td width="20%">&nbsp;</td>
<td width="20%">Strongly Agree</td>
</tr>
<tr>
<td><input name="Delivery" type="radio" value="Strongly disagree" /></td>
<td><input name="Delivery" type="radio" value="Somewhat disagree" /></td>
<td><input name="Delivery" type="radio" value="Neutral" /></td>
<td><input name="Delivery" type="radio" value="Somewhat Agree" /></td>
<td><input name="Delivery" type="radio" value="Strongly Agree" /></td>
</tr>
</tbody>
</table>
<p>We also value any comments or suggestions. So optionally you can type them here:</p>
<p><textarea name="Comments" rows="6" cols="60"></textarea></p>
<p><input name="Submit" type="submit" value="Submit Survey" /></p>
</form></div>
</body>
</html>
  1. Update the "survey.html" file from the console. The embedded HTML editor will open.

  2. Click on the Update button to go to the HTML text.

  3. Paste the HTML shown above into the editor and click Save.

  4. The page should now look something like this:

Now we have all of the components we need and are ready to begin writing rules to present our survey.

Creating the survey selection rules

We will begin by creating the survey selection rules. In this case, the rules are very simple. We use a random number generator to determine if a user should be asked to complete the survey or not.

In this example we want the opportunity to complete a survey to be fairly frequent.

So, we start by updating the "SurveySelection" rule set to look as follows:

The properties for these rules are:

Effectively we create a random number between 0 and 9 (1 digit) and provided the number is below 4, we proceed to perform the survey.

Creating the survey load rules

The purpose of the "SurveyLoad" rules is to prepare any data that may be needed by the other rule sets in the repository. It is often beneficial to do it this way to isolate or prepare data needed by other rule sets, yet at the same time keeping those other rule sets as generic as possible.

In our case, there are a couple of generic things we need to do and check:

  1. We need to start the usual HTTP Request tracking.

  2. We need to ensure a session has been started (meaning a user is logged on).

  3. We need to obtain the customer account number so we can log it (no anonymous data here!).

  4. Once everything is done, we need to proceed with the survey itself.

All of these tasks are very simple, so we show them here as a single step:

The only rule that has any non-default properties is the HTTP Session Object reader. This rule allows us to read the customer account number from the Qwerty session. The properties are as follows:

Creating the survey rules

We are now ready for the actual core process itself with all data and user interface components prepared. So, lets update the "Survey" rule set.

The first issue is to place the survey in the right place in the navigation process, which, in our plan, is to inject the survey on top of main page.

We start by finding out what the name of the page that is being requested is:

The name splitter rule is extremely useful for this as it allows us to split a text string based on a separation character. The separation character in a URL is always "/", so we can find the requested page by using the following properties:

Then we can use a Switch rule to determine how to direct flow:

In this case the Switch variable is URL and adding new chain points to the switch rule determines when logic flows down a certain path.

Note the use of survey.jsp. That page does not exist in the Qwerty application. It is the name of the page that the HTML form in "survey.html" posts its data to. The X Agent simply intercepts this request and deals with it before it ever reaches the application itself.

We are now ready to determine what happens when the user reaches the main page, the first step is to make sure we haven’t already presented a survey to the user in the current session:

The properties for this look as follows:

Basically, we check the session to see if a flag named "DoneSurvey" has already been set. If not, we proceed to see whether we need to present the survey by using the already created "SurveySelection" rule set:

If the response comes back that we need to perform the survey, the next action is very easy. We read the already prepared JavaScript "showsurvey.js" file and add it to the response being sent back to the user:

Once again, the properties are shown here:

This takes care of presenting the survey to the user. Now we just need to handle the response from the user to the survey, the first step of which is to record whether the user has in fact responded to (or denied taking part in) the survey:

We record this in the session using the following properties:

Next, we check if the user hit the "Submit" button and if yes, we record the answers in the flight recorder. If no, we simply return the user to the main page, using a little bit of JavaScript to remove the survey.

The properties are as follows:

Optional index fields: ProductRange,Pricing,EaseOfUse,Delivery,Comments

Response data: "<script>parent.document.location='main.jsp';</script>"

The little piece of JavaScript used here reloads the "main.jsp" page. As the survey flag is now set to "X", the survey will not re-appear, and the user can continue as normal.

Creating the survey configuration

The configuration for this example is very easy. Simply create a new configuration in the Customer Survey repository and name it "SurveyTest". The following shows all of the relevant parts that must be completed for the configuration:

Testing

You are now ready to test the survey rule set. Deploy your new configuration to the Qwerty demo server and start it. Then log into Qwerty. There is approximately a 1 in 3 chance of you getting a survey request. To quickly invoke a survey, click on the "Set up 3rd party" button and then "I'm finished", until a survey request appears. Once you have completed or rejected a survey request, log out and log back in to be presented with another one.

Make sure you answer 4 or 5 surveys at this point.

Setting up the flight recorder definitions

We now have some data in the flight recorder, so we need to set up a definition for it in order to view the data from within the console.

The following shows the definition used in this example:

Seeing the survey results

Once you have done this, select Flight Recorders from the console menu and click on SURVEY:ANSWERS. Leave all of the fields as default and click on Search (tip: if you only wish to see survey answers with comments, put an uppercase "A" into the "Comments:" from field and a lowercase "z" into the to field).

The survey results submitted will be shown:

You can now click on the graph of one of the questions. The result is a pie chart showing you the answer distribution:

Using the flight recorder search filters, you can now use the responses to better understand your customer satisfaction ratings. For example, you can see if Firefox users generally rate the ease of use of your site higher than Internet Explorer users or vice versa.

Potential improvements

The sample created here is fully functional, but for production purposes, you may wish to add a few things. Some possible improvements are:

  1. JavaScript validation to ensure the customer has completed the form before submitting it.

  2. Logic in the SurveySelection rule set to ensure that the same customer does not get the survey more than once every 6 months (The History Summary rule or the History Recorder rule are both useful for this purpose).

PreviousDNS Multi ProtocolNextCHANGE HISTORY

Last updated 4 months ago

generated interface
html page
SurveySelection rule set
Random Number rule properties
If Condition properties
Exit Rule properties
SurveyLoad rule set
HTTP Session Object properties
Survey rule set
Number Spliter properties
Survey rule set
Survey rule set
HTTP Session Reader properties
If Condition properties
SurveySelection.xml rule added
Survey rule set
File Reader props
HTTP Response Addition props
Survey rule set
Set Variable properties
HTTP Session Writer props
Survey rule set
If Condition props
Flight Recorder Trigger props
HTTP Response props
Configuration, general tab
Input source tab
Databases tab
Flight Recorder
Flight Recorder: Survery: Answers Page 1
Flight Recorder: Survey: Answers visualization