tags:

views:

114

answers:

2

I have a web site that spits out links to third party sites. Now these third parties want MY site to track their clicks. How do I do this without ruining the SEO-friendly nature of a plain link?

Currently an ad link is just an anchor:

<a href="http://adsiteA.com"&gt;Come Visit Site A!</a>

I can easily change the links to something like this:

http://mysite.com/clicktracker.aspx?redirect=adsiteA.com

But won't that kill any search engine benefits of linking to their site? If not, I'll happily do it this way... What are my other options? An onmousedown script that hijacks the click and does a postback then redirect?

+2  A: 

If they're paid links, Google says they're not supposed to benefit your advertiser's PageRank. (In fact you could get penalized for trying to subvert this)

http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=66736

JerSchneid
Good answer, thanks! Sort of makes the rest of the question moot.
Bryan
True... at least you can go ahead and track clicks in the easiest way possible :)
JerSchneid
+2  A: 

Do your third party sites want you to report on all the bots and spiders that have crawled your site and followed the links, or just "real" people?

If it's the latter, you could do something along the lines that google use for their search results.

Basically, you render the link out normally, but add an OnMouseDown event to it, so that a spider that doesn't use a mouse follows the standard link, but a normal browser will fire the JS event first.

What you would end up with is something like this:

<a onmousedown="return trackMe(this)" href="http://example.com/"&gt;

And the trackMe method is then performing the redirect to the tracking page, which then issues a 302 redirect to the third party site.

You'd obviously want to check how this works for users navigating via the keyboard or similar (i.e. using Space or Return to follow the links).

Zhaph - Ben Duguid