I need to get an idea of the average "time on page" or "page view duration" for each page on my websites without client-side scripting (such as using onunload event handler).

Is any of the free log analyzers capable of doing this? I looked at Webalizer, AWStats and Analog, but they don't seem to have such a function. The closest thing is "visits duration" in AWStats, but I'd like to see "page view duration" instead.

I know that visitor tracking is inaccurate without client-side scripting, but I can bear with it. Google Analytics seems to provide a "time on page" metric without hooking the onunload event (but correct me if I'm wrong), so I believe this is possible.

5 Answers
5

You can't tell how long people spent
reading each page. Once again, you
can't tell which pages they are
reading between successive requests
for pages. They might be reading some
pages they [cached] earlier. They
might have followed a link out of your
site, and then come back later. They
might have interrupted their reading
for a quick game of Minesweeper. You
just don't know.

You can't tell how long people spent
on your site. Apart from the problems
in the previous point, there is one
other complete show-stopper. Programs
which report the time on the site
count the time between the first and
the last request. But they don't count
the time spent on the final page, and
this is often the majority of the
whole visit.

Stephen Turner, the author of analog, is a bright guy - ex-Cambridge statistician - and I'm inclined to agree with him on this. He justifies his arguments in the link I sent above.

Analog will tell you what is definitely knowable from your web stats, and it will tell you very quickly. Trying to get more is guesswork, and if you want a guess, why pay someone else to make it? Random number generators are five a penny, so use one of them instead.

It's a useless statistic anyway. If I go to some commercial website, spend ages trying to find/buy something and then go to amazon, find it quickly and buy it using single click then page viewing statistics will probably show I spent much more time on the "other" site. Yet Amazon got my money - the "statistic" that actually mattered.
–
RobMDec 29 '10 at 12:33

@Robert Moir What if you're trying to identify the portions of your site that your users have the most trouble navigating? i.e. yes, they're abandoning their carts to shop at Amazon, but is it because they can't find the "add to cart" button on the product page or because the product images aren't appealing or the price is too high or ..? Time on page helps identify your users' habits and define their experience - not necessary but not entirely useless, either.
–
danlefreeDec 29 '10 at 16:42

Time on page would help you if you could know it, but you can't from your logs. If you want to take a bunch of test users and film them navigating your site, then you can know it.
–
MadHatterDec 29 '10 at 17:12

As Madhatter has written, relying on the logs for this information will not give an accurate picture. Also, as with most statistics, you have to spend a lot of time thinking about what you are actually measuring - are people spending time on the page because its interesting or because its hard to understand? Capturing the data in javascript will give quite different behaviour from looking at the logs (consider what happens when the user has multiple windows open).

AFAIK, there are no tools available, commercial or free which do this kind of analysis - including Google Analytics (malfy: can you provide a reference?). However writing your own is not overly taxing - but you'll certainly need to use mod_usertrack or require sessions throughout to differentiate between users - and log the relevant cookie along with the mimetype for a request - which means you're no longer using the standard log formats.

On the upside, the same machinery also allows you to start looking at caching effectiveness and clickstream analysis (also areas that most of the current generation of analysers are poor at).