Create embedded data to control wether respondents followed instructions | XM Community
Skip to main content

I want to show my respondents a website via hyperlink and then ask them some questions about this website. I want to make sure that they followed my instructions and clicked on that link.
How to do this?
I wanted to do it like this guy:
https://www.qualtrics.com/community/discussion/comment/28646#Comment_28646So, he uses JS to set embedded data, wether or not they clicked on his link. I used his code to do the same and I defined the embedded data field in the survey flow but it does't work. The field for the embedded data just stays empty.
How can I solve this problem?

Hi,
Use the below JS code, this will disable the Nextbutton until the respondent click on the hyperlink. If they click on hyperlink then the next button will be enabled.
Make sure you create the "LinkClicked" embedded variable at the stat in survey flow.
Qualtrics.SurveyEngine.addOnReady(function()
{
jQuery('#NextButton').attr('disabled',true)
var cnt=0;
jQuery('a').click(function(){
cnt++
Qualtrics.SurveyEngine.setEmbeddedData("LinkClicked",cnt);
jQuery('#NextButton').attr('disabled',false)
});

});



https://www.qualtrics.com/community/discussion/comment/29038#Comment_29038Thank you very much, it works!


Leave a Reply