This is a guest post from Gary Angel, President of Semphonic, a web analytics company based in San Francisco:
In my last post on this topic, I showed how to capture the respondent's "Survey ID" in the web analytics solution. That's as far as some integrations go but it's hardly satisfactory. In this post, I'll show how to capture response data and integrate it into the web analytics tool.
There's really no good reason to stop with integrating only a respondents Survey ID into Omniture - it's the most bare-bones and least useful level of integration. It's easier AND more useful to integrate actual response data directly into the web analytics solution in real time using the tag. QuestionPro lets you do this, but there are few caveats.
First, with the free version you can't do it very well and you can't do it the way I'm going to show you here. With the almost free version, you have five custom variables you can use. Everything I'll show in this post can be done with the "almost" free version. With the very inexpensive enterprise version you have pretty much all the custom variables you might ever need and you can do the really fancy stuff I'll show at the very end.
Custom variables in QuestionPro aren't the most flexible constructs in the world, but they can do the job.
Here's a screenshot of some sample code that sets a couple of custom variables based on the answers to a couple of questions:

The logic here is pretty simple. Each "if" statement tests the value of single question. Each question in QuestionPro is identified by a string that is usually something like "Q1" or "Q13." For questions that have multi-parts, you can access each part by adding an _X to the QuestionName. So Q1_1 is the first response to Question 1 and Q1_3 is the 3rd response (this often comes into play when you are grouping multiple ratings questions under a single heading).
The value of the Question is simply the ordinal number of the response. So if ${Q1} is equal to 1, it means the respondent picked the first option. A value of 3 would be third option, etc.
You have to assign string values to the custom variables and the statement:
$survey.updateCustom2("boredom") sets the QuestionPro Custom2 variable to the assigned string - in this case "boredom."
This method means you're code gets pretty bulky but it's very easy to write.
One peculiarity with QuestionPro (and there are few when it comes to the scripting) is that the script needs be placed after a page break and can't be placed on the Thank You page. This can be a hassle if you prefer a single page survey and want to integrate Omniture. But for most surveys it falls out quite naturally.
Now that you've captured the custom variables, putting them Omniture is a cinch. On the Thank You Page, you just set some s.props or s.eVars (these are the two basic types of Omniture variable) with the responses. Here's a sample of the code:

At this point, with probably no more than 1-2 hours of work, you've got your survey-data, including actual responses, integrated real-time with Omniture!
There are a couple of issues. We've stored each question in a single Omniture variable. This is completely appropriate if you want to integrate only a few of the most important questions into the behavioral stream or if you are running a short survey. But if you want to store say 25-50 questions in Omniture, you'll probably find you don't have enough variables to do the job.
Sure, Omniture's SiteCatalyst comes with 50 props and eVars, but unless you're implementation is pretty slender, there's a good chance you don't have all of them available for survey responses.
Still, many, many sites are happy integrating only the top 4-5 questions with the behavioral stream.
And if that's good enough, you're done.
But you don't have to stop with the integration of a few key questions into Omniture. Wouldn't it be nice to have all the survey data in your web analytics tool?
There are a couple of ways you can do this. First, let's suppose you are more interested in having a unified reporting platform for the survey data than you are in the web behavioral integration. Instead of sending the web analytics data to an existing report suite, you can send it a special report suite that is just for survey responses. Since this is a clean report suite, you have all the props and eVars available to you and you can just save each response in a separate variable. That means that everyone in the organization can use Omniture to look at survey information, dashboards and reports. It also means you can use Omniture's Excel Integration to create survey reports for distribution. Pretty nifty.
Concerned that you wouldn't get the behavioral information? No sweat. There are two ways to have the best of both worlds. Here's method number one: drop the basic behavioral integration tag on to the Thank You Page. This tag sets the Response ID and a couple of key variables in the Omniture Report Suite that captures all of the real user behavior. Now drop the tag on again but change the report suite and assign the additional custom variables. You'll pay for the extra server call of course, but we are talking survey volumes so the cost is always minimal. Now you've got a report suite with all the survey data AND you are populating your behavioral suite with the key questions.
There's an even easier way though (unfortunately, it involves a bit of expense). You can stick with your comprehensive tag that captures every question and add an Omniture Vista rule to copy the data from the survey report suite to the target report suite that contains all the behavior. You can even handle multiple surveys and report suites this way by simply passing the appropriate target report suite in an s.prop. The Vista rule copies the data and only the key variables to the real report suite. You've got the best of both worlds with a single tag. The cost is relatively small - just what you have to pay Omniture one-time for the Vista rule.
The dedicated report suite to save survey data was originally concocted by one of our Senior Consultants, Jesse Gross, and it's pretty clever. But I think it's annoying that you can't have all of the survey data integrated with the online behavioral data with this method. Fortunately, there's a way to do that as well. While it might be overkill in some cases, it really does provide a best-of-all-worlds level of integration.
It's easy enough to capture the information from multiple survey responses in a web analytics variable - you can simply concatenate them into a string. Since the QuestionPro language just substitutes custom variables wherever they are found, you can build a javascript line that looks like this:
s.prop6 = "Q1:{customVar1}^Q2:{customVar2}^Q3:{customVar3} etc.
If you're using this method, you can string many values together (it's best to use just the numeric response values) into a single variable. You might end up passing something like this:
s.prop6 = "Q1:3^Q2:6^Q3:0^Q4:10^Q5:1^Q6:Yes^Q7:0^Q8:^Q9:7^
In Omniture, props and eVars have a 100 character limit. So if you assume that each numeric response can take a maximum of 6 characters, you can store 16 questions in a single variable. That means you could capture most online surveys with 3-4 variables.
You're probably thinking that capturing the responses in string values like this may be clever but not very useful. It would awfully hard to use data stored in this fashion. And you'd be right. But there's a way to solve that problem too. In Omniture you can use a tool called SAINT to lookup and translate values. You can even create multiple SiteCatalyst interface variables from a single string value. In other words, you can use SAINT to change a string like the one above into 9 different named variables in the interface, with each response translated into the correct survey equivalent. All you need to do is build a SAINT table with the translations.
When I first thought of this idea I imagined that we could simply generate a SAINT table for every possible survey combination. A quick look at our client's surveys quashed that notion. Consider a block of six 1-10 "How satisfied are you with..." questions: this yields fully a million possible combinations. A full survey would have many more possible answer combinations than could ever be captured in a simple lookup tool like SAINT.
But here's the thing - we know that in the real-world the number of combinations must be much smaller for the simple reason that even if every single survey is completely unique (as may be the case) we are only surveying thousands or tens of thousands of visitors. There simply can't be more instantiated combinations that there are respondents.
So here's where the tricky part comes in. Omniture has a programmatic interface (API) for both reporting and SAINT. Using these two APIs, you can implement full survey tracking on all questions.
The idea is startling simple. Using the API, your application reads the string values actually instantiated in each s.prop variable. It parses the string values and builds a SAINT table that translates every unique combination actually stored. It then uses the SAINT API to submit the updated table. The result: an automated system that translates the values of every survey question into something that is easily human readable.
Now I'm not going to pretend that writing an API application like this is anything like as easy as the basic integration of a small set of VOC questions into your report suites or even the capture of the entire survey in a dedicated survey report suite.
As I said in my last post, building any application is going to take a pretty decent amount of work - this is really a pretty simple application but it is still an application. Keep in mind, however, that this method will give you full, complete integration of the survey data into your existing analytics tool. That seems like it might be a worth enough to make the effort worthwhile.
What I hope you take away from this is two-fold: first, that there really is no excuse not to be at least capturing key survey responses in the web analytics solution on a real-time basis. Second, very rich integration of the survey data is both possible and practical using QuestionPro and almost any web analytics solution including the leading enterprise solution - Omniture.
So if you are running QuestionPro surveys and have a web analytics tool but aren't integrating the two, you really should take a crack it. The basic levels of integration are so simple that there is no excuse for not doing them yourself. And even the fanciest levels of integration can be done without all that much expense in either time or money.
I hope this short series gives you a good sense of what's really involved and what the opportunities for rich integration can actually be.
More Info:
[Gary Angel is President of Semphonic, the leading independent web analytics consultancy in the United States. Headquartered in the San Francisco Bay Area, with offices in Washington, D.C. and Boston, Semphonic works with all of the major web analytics tools including Omniture, WebTrends, Unica, Google Analytics and Coremetrics. Semphonic clients include companies like the American Express, Barclays, the BBC, Charles Schwab, Genentech, Intuit, Kohler, the National Cancer Institute, National Geographic, Nokia, and Turner Broadcasting.]