Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The method most sites use for this is to have a script on your site handle the redirect. So instead of the link being directly to:</p> <blockquote> <p><code>http://websiteB.com</code></p> </blockquote> <p>the link goes to something like:</p> <blockquote> <p><code>http://websiteA.com/link/websiteB.com</code></p> </blockquote> <p>The "link" script logs the request and then forwards them to the address (this should be done instantly, don't give them a "forwarding you to Website B in 3 seconds!" page).</p> <p>Note that as a <em>visitor</em> to your site, I much prefer a method where the link's destination is apparent when I hover over the link, as opposed to the method that some sites use where all you see is an id. What I mean is, instead of the link being something like:</p> <blockquote> <p><code>http://websiteA.com/link/websiteB.com</code></p> </blockquote> <p>they instead have a link like:</p> <blockquote> <p><code>http://websiteA.com/link/483</code></p> </blockquote> <p>Showing the destination can be achieved in a few ways. One way is something like I described above, where the destination is part of the query string. Alternatively, you can use some Javascript for this. The status bar's value can be changed with Javascript by setting the <code>window.status</code> variable, but many browsers prevent this by default (Firefox, for example).</p> <p>Google has found a sneaky way around this problem by actually using Javascript to change the <strong>link</strong> instead of the status bar. When the page is loaded, the links in the results list go to their actual destinations, but every link has an <code>onmousedown</code> javascript event that changes the link when you click on it. You can see this in action by right-clicking on a link. After you've done that, hovering over the link will now show the true destination (Google's click-tracking script) in the status bar instead of the result's real URL.</p> <p>Of course the information displayed with any method could be a misrepresentation of where I'm actually going to be sent, but I still prefer it over seeing a meaningless id number.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload