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
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.
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>
Glad to hear that. All the best!! :)
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.