Forum Moderators: coopster

Message Too Old, No Replies

What's the opposite of a referer?

e.g., Where someone goes when they leave your site.

         

HughMungus

3:23 am on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is there a server variable for this?

TIA

digitalv

5:07 am on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nope. But there is a way to track outbound links using whatever your normal logging method is.

Just make a page that does nothing but redirect to another page based on the querystring variable "URL". Then, when you want to create a link that sends someone away from your site, link to redirectpage.asp?URL=http://www.wherever.com

(replace .asp with .php or whatever language you're comfortable with)

Then just look in your logs and see how many hits you got to redirect.asp and all of the querystring data submitted.

ergophobe

2:38 pm on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Not to belabor the obvious.... This will not, of course, work when someone leaves your site with any method other than clicking on a link. So you get a good measure of which of your outbound links are most successful, but you get no real idea of which pages cause you to lose visitors because they shut off the browser, type in a url or open a bookmark/favorite.

Lord Majestic

2:41 pm on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is not possible to gain full visibility as to where customers go after your website unless you are prepared to pay big bucks and use one more or less well known company that signed up ISPs to resell logs of their customers for analysis softwre to determine which site they visited after/before they came/left yours.

HughMungus

5:49 pm on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yeah, I know I can do tracking if all my links are redirects/tracking links. I have that setup for my affiliate links. I was wondering if a server can tell you where someone goes to be able to track, for example, adsense clicks. I'm actually kind of surprised servers *don't* log this. This isn't even registered in server logs?

py9jmas

5:53 pm on Aug 25, 2004 (gmt 0)

10+ Year Member



I'm actually kind of surprised servers *don't* log this. This isn't even registered in server logs?

How is a server going to know where a visitor goes next? You only know where they came from as a matter of courtesy with the browser sending a referer header. When a visitor goes elsewhere, they just start connecting to the other webserver with their requests.

dmorison

5:56 pm on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm actually kind of surprised servers *don't* log this. This isn't even registered in server logs?

There is nothing to log because it is nothing to do with your server.

HTTP is stateless anyway; once a browser has received a page it can close the connection and that is the last contact your server has with that client (web browser).

HughMungus

6:22 pm on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How is a server going to know where a visitor goes next?

Duh. Good point. I forgot about statelessness.

So has anyone figured out a way to track outbound clicks without making them redirects?

dmorison

6:30 pm on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So has anyone figured out a way to track outbound clicks without making them redirects?

Only possible if you're happy to rely on JavaScript.

Use "OnClick" within the <a> tag of your link to call a function that loads a web bug image (single pixel) into the document. If the web bug is served by a PHP script (see below), then you can capture anything you want off the URL, which of course you render dynamically containing an ID for the URL that has been clicked, or the URL itself if you wish.

HTML with web bug click through tracking


<script type='text/javascript'>

function oc(link)
{
document.write("<img src='imagesrc.php?url="+link+"'>");
}

</script>

<a href='http://www.example.com' onclick='JavaScript:oc("www.example.com");'>Example</a>

imagesource.php


<?php

// here you can log $_GET["url"]

header("Content-Type: image/gif");

require("singlepixel.gif");

?>

...of course you have to make yourself a singlepixel.gif file (just use your favorite drawing package) and dump it the same directory as imagesource.php.

Timotheos

7:11 pm on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well you got me thinking. We could create a function that takes the IP address and the referrer, puts that into a formula that uses Bible Codes, star alignment and a coin toss to make a prediction on where the person is going to go. Once perfected we could pitch it to the Apache group and have something like $_SERVER['PROPHETIC'] or $_SERVER['ESP'].

Tim
Sorry, I'm in one of those moods today. ;-)

Lord Majestic

7:13 pm on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



HTTP is stateless anyway

well with cookies and ability to save state in URL parameters I'd say that HTTP is not that stateless!

[edited by: jatar_k at 7:20 pm (utc) on Aug. 25, 2004]
[edit reason] fixed quote [/edit]