Where can I find whether participants played an audio file? | XM Community
Skip to main content
Question

Where can I find whether participants played an audio file?

  • August 8, 2022
  • 1 reply
  • 140 views

Hi - I'd like to know if participants played any of the two audio files embedded in one question. Has anyone explored this before? Thank you.

1 reply

Tom_1842
Level 8 ●●●●●●●●
Forum|alt.badge.img+28
  • Level 8 ●●●●●●●●
  • August 10, 2022

Hi there, you can use the below JavaScript to tell if a respondent played any audio files in the question. First, set an Embedded Data Element at the top of your Survey Flow and create an Embedded Data field called "played" and set the value to 'no'. Then, add the below JS to your question so that the Embedded Data field updates to 'yes' when audio is played:
jQuery('audio').on('play', function() { 
Qualtrics.SurveyEngine.setEmbeddedData('played', 'yes');
});