跟踪何时使用javascript在Qualtrics中单击外部链接 [英] Tracking when an external link is clicked in Qualtrics with javascript

查看:130
本文介绍了跟踪何时使用javascript在Qualtrics中单击外部链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个使用javascript来记录用户是否点击了质量链接的解决方案

I am looking for a solution using javascript to record whether a user clicked on a link in qualtrics

我已按照这些说明进行操作 - 记录点击PDF链接的JavaScript代码 - Qualtrics 但他们不再工作

I have followed these instructions - Javascript code to record click on link to PDF - Qualtrics but they no longer work

另一个人问了同样的问题,但后来采用了另一种方法(跟踪何时在Qualtrics中点击外部链接?

Another person had asked the same question but then went to adopt a different method (Tracking when an external link is clicked in Qualtrics?)

任何想法关于如何让它运作?

Any thoughts on how to get it working?

推荐答案

请原谅我的直率,但之前关于这个问题的问题是OP无能为力遵循指示而不是给出答案。这是一次:

Excuse my bluntness, but the problem with the previous questions on this subject were the OPs inability to follow directions rather than the answers given. Here it is one more time:

1)在问题块之前将嵌入变量添加到调查流程中:

1) Add the embedded variable to your survey flow before the question block:

clicked = 0

2)添加链接到你的问题文字(在HTML模式下):

2) Add the link to your question text (in HTML mode):

This is a link: <a href="http://www.google.com" target="_blank" id="extLink">Click here</a>

3)将以下JavaScript添加到您的问题中,其中extLink与您链接的ID匹配( 2)和clicked匹配(1)中的嵌入变量。

3) Add the following JavaScript to your question where "extLink" matches the id of your link in (2) and "clicked" matches the embedded variable in (1).

Qualtrics.SurveyEngine.addOnload(function() {
    $('extLink').on('click', function(name, event) {
        Qualtrics.SurveyEngine.setEmbeddedData('clicked', '1');
    });
});

如果它不起作用,你做错了。以下调查显示其有效: https://marketinview.qualtrics.com/jfe5/preview/ SV_02JbXhz8qyHgv2d

If it doesn't work, you are doing something wrong. Here is a survey that shows it works: https://marketinview.qualtrics.com/jfe5/preview/SV_02JbXhz8qyHgv2d

点击第一页上的下一个按钮(>>),查看下一页点击的值。

Click on the next button (>>) on the first page to see the value of 'clicked' on the next page.

这篇关于跟踪何时使用javascript在Qualtrics中单击外部链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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