Visit Length

Not open for further replies.


When a visitor visits only one page on a site, the visit length is counted as 0 seconds, because only the times of each pageload are used in determining the visit length.

For a site on which most visits are to read the regular webcomic, a large percentage (at least 50%, I estimate) will load the webcomic page and nothing else, rendering my Visit Length stats primarily useless.

I know that many people have commented on this. I don't know if the following has been suggested before, but is the usage of a bit of extra Javascript possible? I don't know how web tracking works, so I'm just gonna go ahead, be naive, and ask.

This concerns the Javascript function setTimeout(). It uses two arguments: an expression, and a time. expression is run every time milliseconds. Again, I don't know how web tracking works, but for, say, advanced stats, you might be able to use the following code for recording visit length on a specific page.

var visitLength=0;

setTimeout("var visitLength++;", 60000)
I'm really a Javascript novice and don't know whether this would really work or not, but theoretically, this would create the visitLength variable (equalling zero) upon the pageload, then add one to it every minute (60000 milliseconds).

Genius? Too good to be true? Too easy to be true? Already suggested? Not in a million years? :)
Since there's only one instance where the code is executed (upon entry to the page) I don't see what this would do to logging by Statcounter. Maybe it's me who's blinded by preconceived ideas.
Not open for further replies.