Author |
Message |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Sun Nov 07, 2004 10:47 pm |
|
I have been asked by a client and frequent member here for the best way to track a user's time on site. I have a couple of ideas, but I think a think-tank is in order. The main issue, of course, is that you can close the browser and there is no record that you left. You can alter cookie time, make assumptions, use sessions, timed logouts, etc. The issues are pretty well defined, but I wanted to open this up to some good discussion. The goal being to find the best way, even if it is not completely accurate, to estimate as accurately as possible, the time that a person is on a site. Let the discussions begin  |
|
|
|
 |
hitwalker
Sells PC To Pay For Divorce

Joined:
Posts: 5661
|
Posted:
Mon Nov 08, 2004 6:51 am |
|
nice discussion raven....,
but its hard to come up with ideas on that cause you mentioned all of them i guess.
problem is the visitors fear of giving identity.
ok nuke works with cookies and so to me as i understand the tracking can start with login....but as you wrote,when they close the browser.....
so if the tracking continues on ip ?
That would give the problem for members with dial up or other that has different ip's all the time.
problem is also that not one system would allow communicating between a cookie and system..
so whatever it is you have to think of has to be somewhere in the database...
And because it is a weird idea....nuke gives a cookies ,but what if nuke gives a cookies every ?....minute ...?...and overwrite everytime...? |
|
|
|
 |
Raven

|
Posted:
Mon Nov 08, 2004 9:24 am |
|
We're not concerned with anonymous as much as members. But, IP tracking with anonymous would help to identify them. |
|
|
|
 |
Raven

|
Posted:
Mon Nov 08, 2004 3:24 pm |
|
BUMP! Come on y'all. I know there are more of you who can think 'outside of the box'  |
|
|
|
 |
sixonetonoffun
Spouse Contemplates Divorce

Joined: Jan 02, 2003
Posts: 2496
|
Posted:
Mon Nov 08, 2004 3:30 pm |
|
I guess without getting invasive the easiest would be to assign a value in time to each page view and multiply the 2 to get a approximate representation of how long each user has been online. I would imagine from awstats we could get a pretty fair time to use from a larger site like this. I would hazard a guess 1 or 2 minutes per page view is pretty average. |
_________________ [b][size=5]openSUSE 11.4-x86 | Linux 2.6.37.1-1.2desktop i686 | KDE: 4.6.41>=4.7 | XFCE 4.8 | AMD Athlon(tm) XP 3000+ | MSI K7N2 Delta-L | 3GB Black Diamond DDR
| GeForce 6200@433Mhz 512MB | Xorg 1.9.3 | NVIDIA 270.30[/size:2b8 |
|
|
 |
ecvej
Hangin' Around

Joined: Oct 10, 2004
Posts: 45
Location: Northampton, UK
|
Posted:
Mon Nov 15, 2004 3:34 pm |
|
Best idea off the top of my head is to use an iframe that reloads every x seconds and updates a value in the database. eg UPDATE table SET counter = (counter + 1) WHERE name = '$user_name'
If the iframe reloads itself every x secs and the counter is set to 6, you know the user has been on the site for 6x seconds. You would need the frame to operate independently of nuke meaning when you click a link in modules for example, the main frame will go to the link you click but the counter frame wont reload until after x seconds |
|
|
|
 |
Raven

|
Posted:
Mon Nov 15, 2004 4:02 pm |
|
Interesting, but that's quite a bit of MySQL overhead. But, I could use HEAP tables instead and once I detect that a user is gone, write the heap values to disk. I'll mull this over. Thanks! |
|
|
|
 |
ecvej

|
Posted:
Mon Nov 15, 2004 4:16 pm |
|
You're welcome. I agree it is alot of mysql, it has the advantage of being fairly accurate and I guess you'll have to weigh that against the number of users your client wants to log. Heap tables are certainly a good idea if you're going in this direction.
I only started reading this thread 30mins ago, maybe I'll come up with an even more out of the box idea later  |
|
|
|
 |
ecvej

|
Posted:
Sat Nov 27, 2004 10:48 am |
|
Have you gotten anywhere with this Raven? I wouldn't mind seeing some code for me to comment on
Anyway, 2nd idea, how about you stick with the iframe but use javascript to read a value from a cookie and set a new increased value in the cookie every X seconds. Advantage = less sql. Diasadvantage = user may delete cookie.
Compromise = every now and again the cookie data is written to the database.
http://www.the-cool-place.co.uk/javascript/tutorial/javascript3.html#8 |
|
|
|
 |
Mesum
Useless

Joined: Aug 23, 2002
Posts: 213
Location: Chicago
|
Posted:
Sat Nov 27, 2004 4:14 pm |
|
I remember seeing an application made by the author of AdminSecure to record all the moves and times of a user into a database, it's in beta, last time I checked.
[EDIT] Forgot to say that it uses sessions to do that.[/EDIT]
Also There is one add-on called IP-Tracking that does the same minus the time on one page but if you have a busy site, your database will become huge. |
|
|
|
 |
|