Reporting a feedback widget manually

Follow

This guide will go into the reporting of feedback widgets (nps and surveys) manually. It will give more context into how the widget data should be intepreted and how the response should be structured when reporting back to the SDK. Not all SDK's contain the functionality to do manual feedback widget reporting. 

The SDK should provide 2 calls to perform this. One to retrieve the widget data describing the widget and another to report the result.

When receiving the data, it would be packaged in a JSON type object. Their structure would slightly differ depending for which type of widget it is reported.

In case of a survey, it would looks something like this:

{
"_id":"601345cf5e313f747656c241",
"app_id":"5e3356e07b96b63120334842",
"name":"Survey name",
"questions":[
{
"type":"multi",
"question":"Multi answer question",
"required":true,
"choices":[
{
"key":"ch1611875792-0",
"value":"Choice A"
},
{
"key":"ch1611875792-1",
"value":"Choice B"
},
{
"key":"ch1611875792-2",
"value":"Choice C"
},
{
"key":"ch1611875792-3",
"value":"Choice D"
}
],
"randomize":false,
"id":"1611875792-0"
},
{
"type":"radio",
"question":"Radio button question",
"required":false,
"choices":[
{
"key":"ch1611875792-0",
"value":"First"
},
{
"key":"ch1611875792-1",
"value":"Second"
},
{
"key":"ch1611875792-2",
"value":"Third"
},
{
"key":"ch1611875792-3",
"value":"Fourth"
}
],
"randomize":false,
"id":"1611875792-1"
},
{
"type":"text",
"question":"Text input question",
"required":true,
"id":"1611875792-2"
},
{
"type":"dropdown",
"question":"Question with a dropdown",
"required":false,
"choices":[
{
"key":"ch1611875792-0",
"value":"Value 1"
},
{
"key":"ch1611875792-1",
"value":"Value 2"
},
{
"key":"ch1611875792-2",
"value":"Value 3"
}
],
"randomize":false,
"id":"1611875792-3"
},
{
"type":"rating",
"question":"Rating type question",
"required":false,
"id":"1611875792-4"
}
],
"msg":{
"thanks":"Thanks for your feedback!"
},
"appearance":{
"show":"uClose",
"position":"bLeft",
"color":"#2eb52b"
},
"type":"survey"
}

 

In case of a NPS widget, the JSON internally would look something like this:

{
   "_id":"60186d8b3687037dbb058d80",
   "app_id":"5e3356e07b96b63120334842",
   "name":"test3",
   "msg":{
      "mainQuestion":"How likely are you to recommend this product to a friend?",
      "followUpAll":"",
      "followUpPromoter":"We're glad you like us. What do you like the most about our product?",
      "followUpPassive":"Thank you for your feedback. How can we improve your experience?",
      "followUpDetractor":"We're sorry to hear it. What would you like us to improve on?",
      "thanks":"Thanks for your feedback!"
   },
   "followUpType":"score",
   "appearance":{
      "show":"uSubmit",
      "color":"#027aff",
      "style":"full"
   },
   "type":"nps"
}
Was this article helpful?
0 out of 0 found this helpful

Looking for help?