In my survey I am trying to find out how people search to verify information. I want to have a search bar in my question which records the searches and saves them to a data field I can access when I do my data analysis. Ideally, I would also be able to log the links they click through on for each search, but I have no idea how to approach this. I have managed to code a search bar that opens a new tab of the google search onclick, and I have a JS function which appends each search in a local JS array, but I can't access those variables in the analysis. Does anyone know if this is possible/how I could do this?
This is the code I already have:
Search bar:
JS:
arr = =];
function userInput()
{
var input = document.getElementById("userInput").value;
arr.push(input);
Qualtrics.SurveyEngine.QuestionData.addEmbeddedData(url_list, arr); //tried to save as embedded data
Qualtrics.SurveyEngine.QuestionData.setEmbeddedData(url_list, arr); //but doesn't work
return arr;
}
Thanks