Using Track Events to capture Poll Responses with Context
Pendo Guides give a great opportunity to capture active and passive feedback from your clients by way of Polls throughout your application. But, sometimes, you want to have a generic Poll that covers many areas of your product. How are you to know where a user was when they provided that valuable piece of sentiment?
As with many problems, there are a variety of ways to manage this scenario. For example, you might just create a Guide with some Poll question attached and make copies that only target specific Pages across your application. Guaranteed response to Page relationship because each Guide would only show on specific pages.
However, depending on how wide your product is, this may quickly get cumbersome to manage. Enter Track Events!
With Track Events, you can capture the fact that something has occurred within your application, say someone clicked the "Submit Feedback" button on your Guide. You can then pass Event Properties along with that Track Event to capture the state of the application when that particular event occurred - for example, the page and the sentiment.
How does one accomplish such a task? Within the Guide in question, you can add a Code Block element to the Guide Step and include some Javascript code to inject a method that will build and submit a pendo.track() event the same way a client-side Track Event would be configured. Here is an example of what such code might look like:
(function (dom) {
var submitBtn = dom("#pendo-button-########:contains('Button Text')");
//When you hover over the Submit Button
submitBtn.on("mouseover", function (event){
var textarea = dom("#pendo-textarea-########")[0];
pendo.pro = {};
pendo.pro.surveyText = "";
pendo.pro.surveyText = textarea.value; //Store the text typed into the text area into pendo.pro.surveyText
})
//When you click on the submit button
.on("click", function(event){
currentVisitorPage = document.URL;
//Send track event that tells pendo ...
pendo.track("Survey Feedback", {
pageSubmitted: currentVisitorPage, //The page the visitor was on when they submitted the survey
SurveyFeedback: pendo.pro.surveyText //The response the visitor typed in the text area
});
});
})(pendo.dom);
A big shout out to Kristine Rosette Enerio with our Pendo Expert Services team for showing me this creative use of our functionality to drive deeper insights into sentiment data!
Comments
Thank you for sharing!
Please sign in to leave a comment.