创建一个像 Clicktale 和 Crazy Egg 一样的鼠标记录器
我想创建自己的鼠标跟踪器,例如 Clicktale 和 Crazy Egg。跟踪鼠标移动和滚动应该不会太难。但是对文档的所有更改(HTML、输入和选择)又如何呢?
有没有一种简单的方法来记录网站上的所有 JavaScript 操作?那么我可以保存这些操作,然后当我想重播访问者的操作时可以重复这些操作吗?
或者以某种方式记录对文档所做的所有更改(每次发生更改时都保存 innerHTML
可能不是一个选项)。
录音必须与时间相关。
录制完成后,将出现一个 AJAX 请求,该请求复制页面并将新的 Javascript 插入其中,以便可以观看...
I want to create my own mouse tracker, like Clicktale and Crazy Egg. Tracking the mouse movements and scrolling shouldn’t be too hard. But what about all changes to the document (HTML, inputs and selects).
Is there an easy way to record all javascript actions on a site. So I can save the actions and later be able to repeat them when I want to replay the visitor’s actions?
Or somehow record all changes that are done to the document (saving the innerHTML
everytime there is a change is probably not an option).
The recording must be related to time.
When the recording is done there will be an AJAX request that copies the page and insert the new Javascript in to it so it is possible to watch...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先我想说,尽管你所描述的任务听起来很简单,但当你深入研究它时,它实际上要复杂得多。我应该知道,因为我花了近 3 年的时间来制作这样的东西,并且为我的公司 Ehavior 工作得很好。
您可以使用 DOM 突变事件来监视 DOM 树的更改。我想这会给你你所要求的。但您应该注意,突变事件仅在较新的浏览器中可用。
希望这对您仍然有帮助,即使您的问题有点过时:-)
First of all I would like to say that even though the task you are describing sounds to be pretty easy, it is actually far more complex when you dig into it. I should know since I've been spending almost 3 years making stuff like this work and work well for my company Ehavior.
You can use the DOM mutation events to monitor changes to the DOM tree. I guess this will give you what you are asking for. You should be aware though, that the mutation events are only available in newer browsers.
Hope this is still helpful to you, even though your question is a little dated :-)