使用 javascript 库进行用户活动跟踪 [英] User Activity Tracking using javascript library

查看:23
本文介绍了使用 javascript 库进行用户活动跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以跟踪用户在网页上的每一个操作并创建它的日志?这个想法是通过 AJAX 将用户操作的日志传输到服务器并保存它.在每个元素的每个事件上,我可以编写代码/逻辑以在控制台中写入一些日志,但我想知道是否有任何可用的库/快捷方式可以记录客户端网页上的所有操作,包括事件和操作,例如复制、粘贴、单击、双击、选择等及其元素引用.

Is it possible to track every action of a user on a webpage and creating log of it? The idea is to transfer log of user actions to server via AJAX and saving it. On each event for each element I can write code/logic to write some log in console, but I was wondering if there is any library/shortcut available which can log all actions on webpage at client side including events and actions such as copy, paste, click, double click, selection etc. with their element reference.

推荐答案

您可以使用现成的解决方案:

You can use ready-made solutions:

您可以使用 Google Analytics(分析)及其事件跟踪器做出惊人的事情:

You can do amazing stuff with Google Analytics and its Event Tracker:

如果您正在寻找定制的解决方案,您可以使用 PHP 和 JavaScript 尝试以下解决方案:

If you're looking for a custom-made solution, you can try the following one with PHP and JavaScript:

请记住,使用第三方解决方案在性能方面会更好.将鼠标移动的坐标实时写入数据库,需要大量资源.

Keep in mind that using third-party solutions is better performance-wise. Writing the coordinates of the mouse movements in a database in real time, needs a lot of resources.

这篇关于使用 javascript 库进行用户活动跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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