Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

logging time spent on my website

5 views
Skip to first unread message

Yang Li Ke

unread,
Feb 18, 2004, 10:43:35 PM2/18/04
to
Hi guys,
Im about to build a script which will log visitor time spent on my website.
I got a few ideas about this, maybe checking visitors ip and storing that
info in db with time in and then using session vars to check time out ...

Anyone has any ideas about doing that kind of script?

Thank you!
--
Yang


CountScubula

unread,
Feb 18, 2004, 11:09:44 PM2/18/04
to
IP tracking is not a good way, especialy when it comes to AOL users.

general theory is you update a time stamp, and when the time stamp is older
than a predeterimed time, then it is assumed they have left.

when you update time stamp, you could also, calc the differnce between
timestamps, to get an idea of how long they were there.

again, assume they left if diff becomes too great

--
Mike Bradley
http://www.gzentools.com -- free online php tools
"Yang Li Ke" <yang...@sympatico.ca> wrote in message
news:OhWYb.7149$Cd6.6...@news20.bellglobal.com...

Yang Li Ke

unread,
Feb 19, 2004, 1:09:01 AM2/19/04
to
ok but to update that timestamp in a mysql db right?
I need to open up a endless while() on the page or
you have other ideas?

Thanx Count, I know I could count on you ;)
--
Yang


"CountScubula" <m...@scantek.hotmail.com> wrote in message
news:cGWYb.14611$lj3....@newssvr29.news.prodigy.com...

CountScubula

unread,
Feb 19, 2004, 4:38:46 AM2/19/04
to
include a script at the begining of all your pages, or in your main include
script do another include.

then in this script you do this:

update via session or db or flat file, its up to you,
get the timestamp from file/db/session subtract the diff from last time to
this time, an store that as the time on site.
then store current time stamp

you now have 2 items, last length of time, and current time stamp.

thats it, do not do an endless while loop!

then on someother page or stats tracking thing you have going on, loop
through the data, and look at all
the lengths of time.


--
Mike Bradley
http://www.gzentools.com -- free online php tools
"Yang Li Ke" <yang...@sympatico.ca> wrote in message

news:7qYYb.6468$w65.5...@news20.bellglobal.com...

dr. zoidberg

unread,
Feb 19, 2004, 5:55:32 AM2/19/04
to

Yang Li Ke

unread,
Feb 19, 2004, 8:58:24 AM2/19/04
to
Ok I know what you mean but for example the visitor comes in my main page.
I store the timestamp in db ok thats cool. Then he stays there read the
content
without clicking on a link or changing page. Then he leaves the page and
goes
to another site or close his browser. That way I only have the time he came
in
and not the time he left. Thats why I was thinking of a endless loop.

Thank you
--
Yang


"CountScubula" <m...@scantek.hotmail.com> wrote in message

news:Gu%Yb.14683$YW5....@newssvr29.news.prodigy.com...

Larry Jaques

unread,
Feb 19, 2004, 2:26:19 PM2/19/04
to
On Wed, 18 Feb 2004 22:43:35 -0500, "Yang Li Ke"
<yang...@sympatico.ca> brought forth from the murky depths:

I once set up pphlogger for a client. Its nice.
http://www.phpee.com/ freeware/donate


---=====---
After all else fails, read the instructions.
---=====---
Website Design and Update http://www.diversify.com

John Dunlop

unread,
Feb 19, 2004, 4:11:02 PM2/19/04
to
Yang Li Ke wrote:

> Im about to build a script which will log visitor time spent on my website.

What does "on my website" mean?

--
Jock

Default User

unread,
Feb 19, 2004, 5:47:29 PM2/19/04
to


Almost nothing reflecting reality. It's one of the most useless
datapoints around, as it doesn't meant anything much at all.

Brian Rodenborn

Brandon Blackmoor

unread,
Feb 20, 2004, 9:55:41 AM2/20/04
to
Yang Li Ke wrote:
>
> Im about to build a script which will log visitor time spent on
> my website.

No, you aren't: HTTP is a stateless protocol. Anyone who claims to know
how long a visitor looked at your web site is (at best) speaking from
ignorance.

You should read the readme for Analog, "How the web works":
http://www.analog.cx/docs/webworks.html

bblackmoor
2004-02-20

CountScubula

unread,
Feb 24, 2004, 10:39:48 PM2/24/04
to
"Yang Li Ke" <yang...@sympatico.ca> wrote in message
news:ci3Zb.7328$Cd6.6...@news20.bellglobal.com...

> Ok I know what you mean but for example the visitor comes in my main page.
> I store the timestamp in db ok thats cool. Then he stays there read the
> content
> without clicking on a link or changing page. Then he leaves the page and
> goes
> to another site or close his browser. That way I only have the time he
came
> in
> and not the time he left. Thats why I was thinking of a endless loop.
>
> Thank you
> --
> Yang
>

Ok, gotcha, I know what you want, what about something like this:
http://www-2.gzentools.com/test/time.php

There is no endless loop, but rather a piece of java that refreshes an
image, you can have a static image, this is served via a script, and the
script can update a counter thus update interval * count = time spent on
site/page

source:
http://www-2.gzentools.com/snippetview.php?c=Concepts&v=time.php

0 new messages