How do I track whether respondents download a PDF? | XM Community
Skip to main content

I will be providing multiple PDF documents in a survey question and I’d like to track which PDFs the respondents click on. How would I do this for multiple PDF documents?

Hi @jevans6 ,

 

You can set up embedded data to track hyperlinks clicked for each PDF download. Use the code given by Tom G for the same. Just remove NextButton click line.

https://community.qualtrics.com/custom-code-12/help-javascript-code-to-auto-continue-to-next-question-after-clicking-hyperlink-17455

 

Thanks,

JB


Create embedded field respective to each PDF in your survey flow  and set value as 0 at the beginning of the page. Also give the ID to your first PDF hyper link. Suppose your first PDF embedded field name is Click_PDF1=0 and PDF ID is #PDF1. Then go to look and feel » General » Edit header » click source. and paste below code on source pad. Please refer below ss.

 

<script>
jQuery(document).ready(function(){
jQuery('#PDF1').click(function(){
     Qualtrics.SurveyEngine.setEmbeddedData('Click_PDF1', '1');
});
});
</script>

If you are using simple layout then refer this code instead. Set your embedded data field name as __js_Click_PDF1=0.

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

<script>
jQuery(document).ready(function(){
jQuery('#PDF1').click(function(){
     Qualtrics.SurveyEngine.setJSEmbeddedData('Click_PDF1', '1');
});
});
</script>

@ArunDubey This is very helpful, thank you so much!


@ArunDubey This is very helpful, thank you so much!

Glad to hear that. All the best!! :)


Leave a Reply