I would like to track who clicked on a link to open a new window to view a glossary of terms used in the survey. The link is just another survey in Qualtrics in text format. The survey is anonymous, that seems to be the catch here. It would be great to know if a respondent clicked on a link or not.
You could probably pass whatever information you need to identify who accessed the glossary with a query string. That information would be captured in the glossary survey tho, and not in the original.
See this support section :
Passing Information via Query Strings
If you need it captured within the first survey, I would add an ED in the survey flow to track the click, let's say "Click".
Then add an id to your glossary link (using source code in the question editor), let's say "trackClick"
SOM
And finally listen for the click in the question javascript code :
Qualtrics.SurveyEngine.addOnReady(function()
{
const tracker = document. getElementById('trackClick')
tracker. addEventListener("click", () => {
Qualtrics.SurveyEngine.setEmbeddedData("Click", "Clicked");
});
});
Thanks vgayraud. I am new to scripting in Qualtrics, so thank you for your kind and timely response.
So,
1. set a word in ED such as "Click".
2. Go over to where the link lives for the glossary and embed (som.ca is just an example here from what I understand, I would insert the link I have here):
http://www.som.ca" target="_blank">SOM
3.Listen for the click in the question javascript code.
Qualtrics.SurveyEngine.addOnReady(function()
{
const tracker = document. getElementById('trackClick')
tracker. addEventListener("click", () => {
Qualtrics.SurveyEngine.setEmbeddedData("Click", "Clicked");
});
});
My questions:
*Where is the question javascript code in step 3? Is this the question in my main survey that has directions to, Click here to open up the glossary in a new window?
*Where does the last script go? Do I maybe highlight "Click here..." and embed the last code here in step 3?
*Do I do anything else in ED besides list "Click", as I did in step 1?
*How will a tracked click (used the glossary) show up in the results for a respondent? A numeric value or word?
Comment: Ultimately in the results we want to filter for the responses tied to a respondent who clicked on the survey. This could show up in results in any way, not sure what.
Many thanks.
Thanks vgayraud. I managed to get the script to run and was able to see a column in the raw file that is labeled "Click" and a column header that says "Click". Test runs where the link wasn't clicked resulted in a blank entry under the column while test runs with the link clicked resulted in "Clicked" in that column. Each unique run matches with test clicks. Success!
FYI, if anyone needs a visual, I made a YouTube video for how to do this (i.e., tracking whether someone clicked a link).
Here's the video:
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.