Tracking Question - Opinions?

Results 1 to 3 of 3

Thread: Tracking Question - Opinions?

  1. #1
    Join Date
    Dec 1969

    Default Tracking Question - Opinions?

    Recently I have been asked to devise a way to track how visitors to my companies website use our website. ie: where did they come from, and most importantly, where did they go and from what page. <BR>Now, I&#039;ve done plenty of searching on the Internet and found that the first question is quite easy, tracking where they came from is something that the server reports can answer, but answering the later question is a bit more difficult. How can I track where the visitors to our website go and from what link (or page) did they use to go there. <BR>I&#039;ve thought about using simple redirect pages that, when a user clicks on a link to go to an outsite page they hit this redirect page and it then has a counter system that counts how many users used that link to go to &#039;said&#039; page. But, after about 5 or 10 links, that could get a bit overwhelming since it would seem that I&#039;d need seperate reports for each page.<BR>Has anyone else been hit with this question before, and if so, how did you address it? <BR>I should probably apoligize also, for I know this may or may not be an ASP question. But any feedback or thoughts would be great. Thanks!<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default You can do it in ASP...

    ...but you might find better ways.<BR><BR>What you could do in ASP is something like this:<BR><BR>&#060;%<BR>fromPage = Request.ServerVariables("HTTP_REFERER")<BR>toPage = Request.ServerVariables("URL")<BR>SQL = "UPDATE stats SET count = count + 1 " _<BR> & " WHERE fromPage = &#039;" & fromPage & "&#039; " _<BR> & " AND toPage = &#039;" & toPage & "&#039;"<BR>Set conn = ...<BR>conn.Open ...<BR><BR>conn.Execute SQL<BR><BR>%&#062;<BR><BR>You could put that in a #include file that you put at the start of every ASP page.<BR><BR>Now...what&#039;s wrong with it?<BR><BR>(1) It&#039;s a DB hit per page hit. Maybe not a big deal if you will be doing DB work on each page, anyway.<BR><BR>(2) The UPDATE will fail if you don&#039;t already have a record in "stats" with that combo of fromPage and toPage.<BR><BR>This latter problem is easy to fix: If you get a failure on the UPDATE, then simply INSERT a new record, instead. This is essentially identical similar to the situation here:<BR><BR>So use any of those techniques to handle the situation.<BR><BR>*****************<BR><BR>A variation on this would be to keep the stats in a 2D array that you store in an Application variable.<BR><BR>To do that effectively, you&#039;d want a way to quickly convert a URL to a number. Lots of ways to do that, so I won&#039;t belabor you.<BR><BR>You could have a "lastUpdated" value also stored as an App variable, and if you found that it had been NN minutes since the last update, you would dump the array info to a log, just in case of server failure, and reset the lastUpdated time. <BR><BR>******************<BR><BR>So, there are probably better non-ASP ways to do this, but if the site isn&#039;t *too* heavily hit then doing it ASP seems viable to me.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Tracking Question - Opinions?

    theres an excellent open source project that you should take a look at <BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts