URL referral

  • Thread starter Thread starter David
  • Start date Start date
D

David

Here is an example I need some help with.

We want to be able to track from what website a referral
came from. How do you do it? Then of course how can you
keep up with it?

Thanks
 
There are components out there you can buy, no doubt. If you can program a
bit of ASP, you can do it yourself. You would use the
Request.ServerVariables("HTTP_REFERER") to obtain the URL of the referring
page. However, this would have to be done on every page, and you would have
to weed out the references to links from inside the web site, and the blanks
from the page being the first opened during the browser session (not linked
to from another page). You could do it with a Server-side include, and store
the stats in a database.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Hi David,
the easy answer would be to look at the logs/stats package your host
provides - that may meet your needs. What I do with asp and asp.net sites is
add some code to session_start
 
Hi David,
the easy answer would be to look at the logs/stats package your host
provides - that may meet your needs. What I do with asp and asp.net sites is
add some code to session_start which grabs the referring url (if there is
one) the users browser and IP address (also some other stuff have they
visited before how many times etc) and stick this in a database. This way I
can get a nice report of whos using the site where they come from how many
times theyve visited etc.

Obviously there's programming involved here but nothing too onerous - and
once you've written the script once you can use it as is on every other site
you build.

Jon
Microsoft MVP - FP
 
Yes, I had thought that it would be necessary to put code on every page, but
now that you mention it, Jon, the Session_OnStart would be enough, as all
links after that would be from inside the web.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top