要记录的Javascript代码,请单击指向PDF的链接 - Qualtrics [英] Javascript code to record click on link to PDF - Qualtrics

查看:138
本文介绍了要记录的Javascript代码,请单击指向PDF的链接 - Qualtrics的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于Qualtrics中构建的调查实验,我需要记录受访者是否点击了附加到我的一个问题的pdf文档的超链接。我已经设置好了,以便pdf文档在另一个选项卡中打开。我不熟悉Javasctript。记录这些信息最简单的解决方案是什么?提前谢谢你!

For a survey experiment built in Qualtrics, I need to record whether respondents clicked on a hyperlink to a pdf document attached to one of my questions. I have set it up so that the pdf document opens in another tab. I am not proficient with Javasctript. What would be the simplest solution to record this information? Thank you in advance!

另一个用户问了一个关于跟踪外部网页的超链接点击的类似问题,但我不确定我是否可以在文档中使用点击并不完全是外部网页。

Another user asked a similar question about tracking hyperlink clicks to an external webpage, but I'm unsure if I can use a click thru when the document isn't exactly an external webpage.

推荐答案

此过程共有3个部分:

1:使用特定ID设置您的链接,例如:

1: Set your link up with a specific ID for example:

<a id="myLink" href="http://communicus.com" target="_blank">Test Link</a>

2:对于您需要此问题,请添加以下JavaScript(调整ID和嵌入式必要时脚本中的数据变量):

2: For the question that you need this on, add the following JavaScript(adjust the ID and embedded data variable in the script as necessary):

Qualtrics.SurveyEngine.addOnload(function()
{
    var a = $("myLink"); //adjust ID here

      a.onclick = function() {
          Qualtrics.SurveyEngine.setEmbeddedData("clicked", 1); //adjust embedded data variable here
      }

});

3:在调查流程部分添加嵌入数据变量,以匹配您的JavaScript。确保它存在于您的问题所在的阻止之前的调查流程中。

3: Add the embedded data variable, to match your JavaScript, in the survey flow section. Make sure that it exists in survey flow prior to the block your question resides in.

这将允许您跟踪那些点击Qualtrics变量中链接的人。

This will let you track those who clicked the link in a Qualtrics variable.

这篇关于要记录的Javascript代码,请单击指向PDF的链接 - Qualtrics的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆