Forums

ASP

This topic is locked

Recording Website usage

Posted 27 Jan 2009 19:48:47
1
has voted
27 Jan 2009 19:48:47 Javier Castro posted:
Hi Guys,
I developed a website a while back and my client wants to track user usage of the website. Basically he wants to know: who logged-in, when, what pages he visited and when he left. Is there an example of such idea somewhere, a third party application or do I have to start from scratch.

Dosn't have to be too complex, the simpler the better.

The website is in Classic ASP.

Thanks for any ideas leading to a fruitfull headscratch and eureka moment.

Cheers to all.

Javier

Replies

Replied 13 Feb 2009 23:28:14
13 Feb 2009 23:28:14 Andrew Watson replied:
simplest way would be to install google analytics for overview stats, but if its specific stats your measuring against individual users then it depends on what you track...

a quick method allowing good flexibility would be to create a table called user_stats...

then add columns ..

intUser (your unique user reference from your users table)
datAction (a date and time stamp for the action)

...then perhaps a text field for the action type say..."PAGE VIEW", or "USER LOGIN"...(these could be put into a lookup table and referenced by id but text will do..)

then another text field for action details ... for the PAGE VIEW action this field may contain something like "/articles/myarticle.asp"

then just write a wee function ...something like ...

private function userTracking(intUser,strAction,strDetail)
myConnection.execute("INSERT INTO user_stats(intUser,datAction,strAction,strDetails) VALUES (" & intUser & ",NOW(),'" & strAction & "',." & strDetails & "');")
end function


call it whenever you like e.g. in every page header..

userTracking(session("intUser"),"PAGE VIEW",request.servervariables("SCRIPT_NAME")



then you can do all kinds of stats reporting by processing and grouping this data...

just an idea,
Replied 14 Feb 2009 12:50:21
14 Feb 2009 12:50:21 Alan C replied:
I agree with Andrew, I did something like this and assigned an event number, eg login, upgrade etc.
The one that I found more troublesome is log out, if the user actually logs out it's easy to record, but when they just navigate away you are left with a clean-up job that needs to look how long it was since their last activity - it starts to get messy
Replied 18 Feb 2009 01:52:06
18 Feb 2009 01:52:06 Andrew Watson replied:
QuoteI agree with Andrew, I did something like this and assigned an event number, eg login, upgrade etc.
The one that I found more troublesome is log out, if the user actually logs out it's easy to record, but when they just navigate away you are left with a clean-up job that needs to look how long it was since their last activity - it starts to get messy


Yes...logout...lol nightmare...easier with other technologies though, e.g. .net....

But if you are measuring login time, and page view time then the last page view + average visit page view duration (time between views) would be a fair assumption of user departure time. lots can be worked out form the page views...

Cheers
A
Replied 04 Apr 2009 17:31:45
04 Apr 2009 17:31:45 Javier Castro replied:
Thanks Guys. I was so busy completing a project that I forgot to comeback. However, I was able to solve my problem by adding a table to my db and working the times and page views from there. Thanks again.

Reply to this topic