Friday, November 17, 2006

Surveys in emails

I am often asked about including surveys in emails. There are several ways of doing this and we could (and people do) argue for a long long time about the rights and wrong of each approach. Obviously, some people's email readers block any form of html so the ony guaranteed way to esnure your link gets through is to send it as a pure link. If, however, you do want to use html or place a survey in email, These are my preferred three options.

Option 1: Hide complex links within a "Click Here" (or similar) link - EASY, LOW RISK.

This option doesn't duplicate any of the survey in an email BUT usefully hides long and unwieldy links under something that a) takes up less space and b) won't be broken. To do this you need to use a HREF statement. The following example html code will place a link in an email displaying click here and, when clicked on, will take the user to the survey. This should work in most emails but some text only email readers may not display the link.

-- example code begins --

<html>
<body>
<a href="SURVEY LINK HERE">Click Here</a>
</body>
</html>

-- example code ends --

There is a great site (W3 Schools) that enables you to learn and play with html. To try the HREF example click the following link:
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_links

Option 2: Include one or two questions in the email and then take them to the complete survey - DIFFICULT, MEDIUM RISK

Now for something a little more tricky. This option involves coding some html to duplicate question(s) in a survey. Clicking on a button (or link) then takes the user to the survey and auto-populates the answers.

This involves building a html form that presents the question(s) and you can only generate four question types: Text, Radio, Pulldown and Checkbox. In the example code below we present one question (the Net Promoter question) in the html. Note the use of a 'hidden' field that records the SURVEY CODE. This is the 15 digit code that is at the end of a Clicktools survey link. Each of the input options presents a value and passes a corresponding value across to Q1 in a Clicktools survey. Finally, the Input type at the bottom of the code presents a button that actually transfers the answers and presents the rest of the survey to the user. This should work in most emails but obviously will not work if people accept text only.

Please Note: The Code below only works with Anonymous URLs.

-- example code begins --

<html>
<head></head>
<body>
<form action="http://clicktools.com/dashboard/survey/go.jsp">
<input type="hidden" name="iv" value="SURVEY CODE HERE">
<strong>Where 0 is 'Not at all' and 10 is 'Extremely'. how likely is it that you would recommend us to a friend or colleague?</strong>
<table border=0>
<tr>
<td><input type="radio" name="q1" value="1"></td>
<td>0</td>
<td><input type="radio" name="q1" value="2"></td>
<td>1</td>
<td><input type="radio" name="q1" value="3"></td>
<td>2</td>
<td><input type="radio" name="q1" value="4"></td>
<td>3</td>
<td><input type="radio" name="q1" value="5"></td>
<td>4</td>
<td><input type="radio" name="q1" value="6"></td>
<td>5</td>
<td><input type="radio" name="q1" value="7"></td>
<td>6</td>
<td><input type="radio" name="q1" value="8"></td>
<td>7</td>
<td><input type="radio" name="q1" value="9"></td>
<td>8</td>
<td><input type="radio" name="q1" value="10"></td>
<td>9</td>
<td><input type="radio" name="q1" value="11"></td>
<td>10</td>
</tr>
</table>
<br>
<input type="submit" name="OK" value="Submit">
</form>
</body>
</html>

-- example code ends

Again, look at the W3 site for more instructions: http://www.w3schools.com/html/html_forms.asp.
Paste the above code in to one of the example windows to see how this looks.

Option 3: Include the whole survey completely in the email - EASY, HIGH RISK

If you want to actually include the survey in the body of the email itself you can use what is called an IFRAME. This quite simple to do as the code below shows.

Paste the following html in to an email template, replacing the SURVEYLINK with your own survey link and, obviously, test!... Note: Active content in email is increasingly becoming blocked by email readers so this approach will NOT work in some email readers (e.g. where IE security settings are set to HIGH.). If you use this option I would recommend including a link as well at the top of the page giving people an alternative should they not be able to see the survey.

-- example code begins --
<html>
<body>
<p>
Introductory text here </p>
<iframe src ="SURVEY LINK HERE" width="100%" height="400" frameborder="no" scrolling="yes"> </iframe>
</body>
</html>

-- example code ends --

You can change the settings (width, height etc.) to find the right setting for your survey. Again, there is a W3Schools page where you can test the html to see how your survey would look in an email: http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe.

No comments: