Forum Moderators: open

Message Too Old, No Replies

HTTP_REFERER Alternative?

Is there a better way?

         

w_s_o

5:46 pm on Apr 21, 2006 (gmt 0)

10+ Year Member



I have code at the top of each of my pages that looks at the HTTP_REFERER and writes it to a database. This gives us more information to look at than just what's available from the stats package our host provides us.

There are many threads on the unreliability of HTTP_REFERER. My question is, is there something better to use? It's typically fine for once they get into our site--we can easily see the complete path they navigated within our site. But for finding out what sites or search engines they took to get to our site, I'd say that about 50% of the time it comes over blank. I think much of that comes from redirects, etc. from the referring site.

So does anybody have any suggestions for alternatives to using HTTP_REFERER?

john_k

6:03 pm on Apr 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For some reason most internet security software packages now allow people to block the referer tag from being sent. Norton's Internet Security package blocks it by default. I don't know about other packages. But that is why you are seeing the decline in its reliability.

Since the referer tag is supposed to be THE mechanism by which the browser tells the server the URL of the page that referred it, there is not any direct alternative.

For the links to your site that you have control over, you can add a simple parameter to the URL. You could possibly do the same thing for links within your site. However, if someone copies any of these URLs for linking to your site, then you will have bad information. It still might be much better than using the referer tag.

Btw - does anyone know why "referer" with one "r" in the middle is used?

Easy_Coder

6:18 pm on Apr 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For some reason most internet security software packages now allow people to block the referer tag from being sent. Norton's Internet Security package blocks it by default.

They unfortunately see this as a privacy issue.

jdMorgan

6:55 pm on Apr 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> Btw - does anyone know why "referer" with one "r" in the middle is used?

The server variable HTTP_REFERER was misspelled, and after the code was released and this fact was noted, it was too late to change it, simply because so much code depending on it was developed so fast.

Jim

w_s_o

8:11 pm on Apr 21, 2006 (gmt 0)

10+ Year Member



Of course the server logs also contain referrer information. Does that come from essentially the same source? That is, if the HTTP_REFERER is withheld, does that mean that in the log it will also be unknown?

john_k

10:08 pm on Apr 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, the log information also comes from the referer header sent by the browser. So if the browser doesn't send it, your server can't log it and it can't provide it to the scripting engine.