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

How do I track whether respondents download a PDF?

  • June 25, 2023
  • 4 replies
  • 134 views

Forum|alt.badge.img+2

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?

Best answer by ArunDubey

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>

4 replies

Forum|alt.badge.img+15
  • QPN Level 4 ●●●●
  • June 26, 2023

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


ArunDubey
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+41
  • QPN Level 8 ●●●●●●●●
  • Answer
  • June 26, 2023

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>

Forum|alt.badge.img+2
  • Author
  • Level 2 ●●
  • June 27, 2023

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


ArunDubey
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+41
  • QPN Level 8 ●●●●●●●●
  • June 28, 2023

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

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