visualize activity on a website

B

brien

hi all --

I'd like to have a real time visualization of all the visitors on my
website. That is, a list of all the people currently on each page,
updated in real time.

Does anyone have an approach they could share? I'm curious what
technologies people find useful for this kind of thing.

Also, if you don't mind, if you were to code something like this, how
many hours do you think it would take?

Regards
 
G

GArlington

hi all --

I'd like to have a real time visualization of all the visitors on my
website. That is, a list of all the people currently on each page,
updated in real time.

Does anyone have an approach they could share? I'm curious what
technologies people find useful for this kind of thing.

Also, if you don't mind, if you were to code something like this, how
many hours do you think it would take?

Regards

You will not be able to do it in javascript. The closest you will get
is if you use AJAX and have VERY fast response page on the server.
Generally to achieve real-time you will need a client-server type
application, server will maintain connections to (number of) client(s)
and send short updates of status change.
There are various technologies that can be used to achieve this
(CORBA, RMI, sockets... to name a few).
Minimalistic real-time client-server application can be done in about
1-2 days, full application development timing will depend on spec.
 
T

Thomas 'PointedEars' Lahn

brien said:
I'd like to have a real time visualization of all the visitors on my
website. That is, a list of all the people currently on each page,
updated in real time.

Does anyone have an approach they could share? I'm curious what
technologies people find useful for this kind of thing.

Speaking of *real-time* status visualization, if you are willing to accept a
short delay before the update (as in an instant messenger application), then
IXMLHTTPRequest (XHR), or AJAX (Asynchronous JavaScript And XML) as it
called concisely but falsely nowadays, could be what you are looking for.

All depends greatly on how you define a visitor: Do they have to log in?
How would you identify them (think of proxy servers)? For how long is
someone displaying (and not necessarily looking at) a document of your site
considered a visitor?

If you can answer these and similar questions, then it would be possible to
use a server-side application to determine the visitors, and to serve a HTTP
response (e.g. as JSON, XML, or HTML) that can be evaluated by an XHR
application in regular intervals in order to use the DOM to modify the
document tree accordingly.

Of course, you could also use an iframe or any other approach to make an
asynchronous request, i.e. a request that does not require (re)loading of
the parent document resource. While XHR has good support by more recent
HTML user agents, the best method would depend on your expected execution
environment. You can also use one approach as fallback for another if
necessary.
Also, if you don't mind, if you were to code something like this, how
many hours do you think it would take?

It is really hard to say. For the client-side part I would probably not
need more than 2 hours, at most 3 with testing. The server-side part is
the tricky one, and how long it would take to develop that, depends on
how you define a visitor.


PointedEars
 
R

rf

brien said:
hi all --

I'd like to have a real time visualization of all the visitors on my
website. That is, a list of all the people currently on each page,
updated in real time.

You can *sometimes* tell when a visitor *starts* to be on your page.

Please define how you intend to tell when a visitor *stops* being "on" your
page.
 
D

David Mark

You can *sometimes* tell when a visitor *starts* to be on your page.

Please define how you intend to tell when a visitor *stops* being "on" your
page.

Typically you store the time of each visitor's last hit. To determine
"absence", you subtract an arbritrary number of minutes from the
current time and compare it to each. I usually store this information
in a database table so that it is simple to query for just those who
are "present" (or to find the last visitation time of a specific user.)
 
R

rf

Typically you store the time of each visitor's last hit. To determine
"absence", you subtract an arbritrary number of minutes from the
current time and compare it to each. I usually store this information
in a database table so that it is simple to query for just those who
are "present" (or to find the last visitation time of a specific user.)

I repeat, please tell me how you know when a visitor has stopped looking at
a page.

I don't consider your "arbritary number of minutes" as a valid measure of
when a visitor has stopped looking at a page.

Snake oil? :)
 
D

David Mark

I repeat, please tell me how you know when a visitor has stopped looking at
a page.

You don't.
I don't consider your "arbritary number of minutes" as a valid measure of
when a visitor has stopped looking at a page.

It isn't. It is just a way to present a "Who is online" display and
to track the last visitation time for each user.
Snake oil? :)

Not if you don't sell it as something it is not.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top