Is there an existing js lib for capturing user activity browser side?
ie. Scrolling, mouse moving, mouse clicking etc. I've been googling, searching stackoverflow and github but I keep getting links to paid analytic programs which aren't quite what I'm after.
I'm tempted to start building something myself, but the more I think about it, the harder I realise it'll be and I'd be better off using some existing lib if available.
What I'm thinking. Would this be an appropriate way to go about it?
window.onbeforeunload
.I found these two questions here & here. But aren't quite what I'm after.
I want to be able to configure the event aggregation to ask a question on user interaction. Admittedly I'm out of date with Google Analytic, and maybe I'm wrong, but at a glance custom event tracking doesn't seem to fit the bill. Logging specific individual actions isn't what I'm after.
You must write it yourself ( or at least that's what i did ).
Backup question : Is there any javascript library to capture mouse/keyboards events and send them to external server?
Here is a working jsfiddle: http://jsfiddle.net/94dd343y/
$(document).ready(function(){
$('html').mousemove(function(event){
console.log("mouse move X:"+event.pageX+" Y:"+event.pageY);
});
$('html').click(function(event){
console.log("mouse click X:"+event.pageX+" Y:"+event.pageY);
});
$('html').keyup(function(event){
console.log("keyboard event: key pressed "+event.keyCode);
});
});
And so on.
If you want to capture all the events, here is a list: