views:

14

answers:

1

I am using asp.net 2.0. I have 5 web pages in my project. I want to calculate the length of time for which visitor view the page.

A: 

Outline for a tracking system:

  1. Server-side: When the visitor requests the page, generate a unique id and include it in the page. Save the unique id with the user, page, and any other information you wish to track.
  2. Client-side using javascript: When window.onunload fires, send an ajax call to the server to say the user has finished with the page identified by the unique id. Looking up the id saved in step 1, update the length of time visited.

Alternatively, use something like Google Analytics, which does a stellar job of tracking visitors.

Will
what actually is Google Analytics
Read here: http://www.google.com/analytics/ . It's very easy to set up, and tracks many, many things about the visiting users, including what features of a page they click on most! Neat stuff, and worth checking out. Heh, Google for it, and billions of examples around the net. ps. It's free!
Will
but i am using localhost it is not showing my profile any ideas for local host
When using localhost you can't have visitors from outside that machine anyway. When you give your site/machine a DNS/domain name that is accessible by others, then the likes of Google Analytics can use it, even if inside a LAN.
Will