Setting embedded data for hover or mouseover event | XM Community
Skip to main content

Hi, I am looking for a solution using JavaScript/jQuery to record whether a user hovered over or moused over an icon (this icon is in a question response option). I know similar solutions have been found for clicks,
such as : https://stackoverflow.com/questions/38225021/tracking-when-an-external-link-is-clicked-in-qualtrics-with-javascript and https://community.qualtrics.com/XMcommunity/discussion/2809/track-whether-a-link-is-clicked-in-qualtrics-even-a-respondent-leaves-for-the-opened-new-page.
but I am interested in when users access hover over options on my survey for informational text.
My current attempt has been to modify these previous solutions for clicks, but instead passing in mouseover as the event type.
image.png'information' is the id that I define within the question response option for the icon:
image.pngimage.png"hover" is the Embedded Data value that I set to 0 in the Survey Flow section above my survey.
I have used several versions of similar code fragments but all have failed to yield hover=1 at the end. I attempted creating a baseline click version to make sure it'd work with the current code (all the same, but event type is click, and test html is :
image.pngand this runs without fail, setting hover correctly to 1.
I appreciate your help!

@mnguye79 Very old post but just wanted to answer it as it got shown to a similar topic I had a look on in case others will be in need of this. For mouseover this should work: 

Qualtrics.SurveyEngine.addOnload(function()
{
jQuery('#information').mouseover(function(event){
Qualtrics.SurveyEngine.setEmbeddedData("hover","1");
});
});

If working with simple layout, few things need to be done differently. This post should help. 

Best
Christian


Leave a Reply