954,560 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Tracking Mouse Cursor and storing it in database

I am developing a website in ASP.net and I would like to be able to track the mouse movements whilst a user of the site is browsing pages on the site and be able to store the duration in seconds of how long the cursor is left in specific areas on the user's screen (blocks of areas on the screen) back in my site's database.

Is there a .net class which can handle this or can I only do this in JavaScript or AJAX?

I am sure that mouse tracking can be done in Javascript but I can't really store the positions and times collected to my database in the background without interrupting the user whilst he is browsing around the site.

Can anybody please shed some light on this or refer me to some example code which does exactly this?

Thanks,
Matthew

matthewcar
Newbie Poster
3 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 
__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

Thanks for your reply adatapost, however those 2 sites are useless to me.

I only would like to track and store the mouse cursor positions and time durations in seconds on normal/standard user browsers and don't need to use DOM.

If anybody else has any better ideas or links, I would really appreciate it if you could give a helping hand.

Thanks,
Matthew

matthewcar
Newbie Poster
3 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

Thanks for your reply adatapost, however those 2 sites are useless to me.

I only would like to track and store the mouse cursor positions and time durations in seconds on normal/standard user browsers and don't need to use DOM.

If anybody else has any better ideas or links, I would really appreciate it if you could give a helping hand.

Thanks, Matthew

Sounds like you're looking to have JavaScript mouseover + mouseout call a WCF web service which logs your data to the DB. Here's two links that WILL help you:

Check for Mouseover and Mouseout on here: http://www.quirksmode.org/js/events_mouse.html

Calling a WCF service from JavaScript:
http://dotnetbyexample.blogspot.com/2008/02/calling-wcf-service-from-javascript.html

With those two you should be able to accomplish what you're trying to do.

ITSVPS
Newbie Poster
7 posts since Oct 2009
Reputation Points: 15
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: