Dear Forum,
the current situation:
I have some JavaScript code running, that embeds a Chatbot into the survey.
This code also fetches the number of words the user has put in, as well as the number of words that the bot responded with and displays these numbers dynamically.
As these are important variables for my analysis later on, I do not only need these numbers to be displayed during the survey, but I need these numbers to be added to the “answers” given to the question, to perform calculations and regressions afterwards.
Good news is, I have created embedded variables in the survey flow, declaring these as numbers, and I am able to update these embedded variables via my JS code. I have also access to these numbers in the Data & Analysis tab, but not via the Results tab.
The current problem:
Is there a way, to get this embedded data into the results tab too, so I do not run the risk of having to match the numbers to the respective response by hand?
I have attached a stripped down version of my code below.
Any help is appreciated.
Qualtrics.SurveyEngine.addOnload(function() {
function updateEmbeddedData() {
// Update embedded data fields with the current counter values
Qualtrics.SurveyEngine.setEmbeddedData('Ed_UserWordCount', userWordCount;
Qualtrics.SurveyEngine.setEmbeddedData('Ed_ChatbotWordCount', chatbotWordCount;
Qualtrics.SurveyEngine.setEmbeddedData('Ed_MessageCount', totalMessageCount;
}
updateEmbeddedData(); // Update embedded data fields
});