Track whether a file is downloaded in qualtrics | XM Community
Skip to main content
Solved

Track whether a file is downloaded in qualtrics

  • March 8, 2021
  • 12 replies
  • 497 views

I have uploaded a word document to a survey and am hoping to track which survey takers down the document. I have used a previous thread about tracking whether a link is clicked to get started. I created an embedded variable, "download", and set it equal to "0". Then I used some javascript provided in this post: https://www.qualtrics.com/community/discussion/2809/track-whether-a-link-is-clicked-in-qualtrics-even-a-respondent-leaves-for-the-opened-new-page. I can tell that the issue is with the JQuery link since it uses a #extLink. However, I am not sure what to use here for a downloaded file. Any help would be appreciated.

Qualtrics.SurveyEngine.addOnload(function() {
  jQuery('#extLink').click(function(event) {
    Qualtrics.SurveyEngine.setEmbeddedData("download", "1");
  });

Best answer by ahmedA

Change it to this:
If you are interested in learning more about covid-19 vaccine availability and would like to schedule an appointment please download the full document by clicking on the following text link: Covid 19 Vaccine Resources - Pennsylvania
Now when someone clicks on it, download should be set to 1.

12 replies

Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • 2050 replies
  • March 8, 2021

How are you setting up the file download? Link? Button?
Share a screenshot of question HTML


  • Author
  • 2 replies
  • March 8, 2021

The file is downloaded by clicking on some of the highlighted text in the question.
Here is the HTML for the question:
If you are interested in learning more about covid-19 vaccine availability and would like to schedule an appointment please download the full document by clicking on the following text link: https://smeal.qualtrics.com/CP/File.php?F=F_3fkQ9Y7hp6JaWQ6" target="_blank">Covid 19 Vaccine Resources - Pennsylvania


Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • 2050 replies
  • Answer
  • March 8, 2021

Change it to this:
If you are interested in learning more about covid-19 vaccine availability and would like to schedule an appointment please download the full document by clicking on the following text link: Covid 19 Vaccine Resources - Pennsylvania
Now when someone clicks on it, download should be set to 1.


  • Author
  • 2 replies
  • March 9, 2021

Forum|alt.badge.img+2
  • Level 2 ●●
  • 5 replies
  • June 25, 2023

@ahmedA I actually have the same question, but I don’t understand the solution. What was changed? What was changed in the javascript?


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

this is same as your other question @jevans6  😀


Tom_1842
Level 8 ●●●●●●●●
Forum|alt.badge.img+28
  • Level 8 ●●●●●●●●
  • 909 replies
  • June 26, 2023

ahmedA original comment:


Change it to this:

​If you are interested in learning more about covid-19 vaccine availability and would like to schedule an appointment please download the full document by clicking on the following text link: <span style="font-size:22px;"><strong><a href="https://smeal.qualtrics.com/CP/File.php?F=F_3fkQ9Y7hp6JaWQ6" target="_blank" id="extLink">Covid 19 Vaccine Resources - Pennsylvania </a></strong></span>

Now when someone clicks on it, download should be set to 1.


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

@Tom_1842 Thank you!


Forum|alt.badge.img+1
  • Level 1 ●
  • 6 replies
  • January 15, 2024

Hi, I’m trying to do the same thing, do you put this code in the javascript box? 


Forum|alt.badge.img+1
  • Level 1 ●
  • 6 replies
  • January 15, 2024

This is my current HTML code. 

Provided is a downloadable summary for working with gifted and talented youth:&nbsp;<a href="https://ucf.qualtrics.com//CP/File.php?F=F_038ZRLTKVM5zOl0" rel="noopener" target="_blank">Giftedhandout</a>&nbsp;

 

I am looking to track the number of downloads. I have tried support with zero luck. 


Forum|alt.badge.img+2
  • Level 2 ●●
  • 5 replies
  • January 16, 2024

Hi! So you basically need to do 3 steps. First, you need to add an embedded link in your survey (in survey flow) before question where you have your PDF that you’d like to track and set it equal to 0. Then you need to add the following in javascript:

Qualtrics.SurveyEngine.addOnload(function() {
  jQuery('#extLink').click(function(event) {
    Qualtrics.SurveyEngine.setEmbeddedData("extLink", "1");
  });

 

I’m not sure whether this is necessary, but I make sure the embedded link, and the “extLink” above have the same name. The third piece is adding the “extLink” name in the html with id=”extLink”, which you don’t seem to have above. I think I usually put the id before “target”. Similarly, I just have all of the steps with the same name, as I’m not 100% sure which links to which so it makes it easier.

 

I hope this helps!


Forum|alt.badge.img+1
  • Level 1 ●
  • 6 replies
  • January 19, 2024

@jevans6 Thank you so much for your reply. I clearly did something incorrectly. It still says zero after I tested it. I think there is something I am doing incorrectly in step one. It appears like I am just creating a name and setting it to 0 which doesn’t feel right. Any thoughts?