views:

63

answers:

4

Is there a way to log how long a visitor stays on my website?

A: 

Some services/tools: Google Analytics, Piwik, Woopra, ...

The MYYN
+1  A: 

Write some JavaScript ping function to send heartbeat requests every few seconds.

That is, if you wish to do it manually. Otherwise, use some statistics software. Many hosters put something for you to use. Or just add Google Analytics to your site.

Developer Art
+1  A: 

Following Developer Art's suggestion, there is a very good implementation of this heartbeat method at ajaxpatterns.org.

Daniel Vassallo
A: 

Google Analytics will record the time between pageviews on your site. This means that single pageview sessions (bounces) are not factored into time on site, nor is the time spent a user spends on their final pageview for multi-page visits. It'll give you a decent ballpark figure though.

martynj