Copy link to clipboard
Copied
Hi everyone
I'm working on a system that will track the time spent in my application by each user, The only Idea I found is:
Log every session start time and sessionID and then update it when the session is closed. This approach won't give me an accurate results
Anyone have a better idea ?
Thanks
Copy link to clipboard
Copied
I don't think that would be a very good measure at all. The timeout value which is where the system waits a specified amount of time (twenty minutes by default) for any new requests would be a huge factor in this average.
This is not really something you can measure acurately without having control over the client. The best you can really do is record each request made by a given user. Presume that the time spent on the site is the amount of time spent between the first request and the last request.
You will want to do your best to filter out robots which allmost always make every request as an unique user, because they do not pass back the cfid and cftoken cookies that allow the system to know this is a returning 'user'.
You may also have to account of other users who block or do not allow cookies, and users who only make a single request of your site and move on.
All of this depends greatly on what type of site we are talking about and what type of users are you traking.
Copy link to clipboard
Copied
You could start out trying Google Analytics, it's free and you just drop a tag in your site. I've used it and although I like to code things myself, this was a quick fix to get the "Avg time on site" data.
Copy link to clipboard
Copied
Hi..
I think may be you can find the close proximity of average time spent by having the record of total time spent.
http://www.labortimetracker.com/
Copy link to clipboard
Copied
You will get the most accurate tracking system if your users have to log in.
Copy link to clipboard
Copied
A realistic approach would be to send the 'time this page was generated' as a hidden-field in the forms. When the data comes back, examine the
value and, if it is reasonable, use it to calculate your elapsed-time.
For an inward-facing (intranet) application, this strategy is pretty reasonable and robust. It's not the only way (you could use Session variables, for instance), but it ought to work pretty well. It certainly has the compelling advantage of being quite easy to do . . .