Bryan
Bryan

Reputation: 8778

Track ad link clicks but maintain SEO-friendly links?

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">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?

Upvotes: 4

Views: 320

Answers (2)

Zhaph - Ben Duguid
Zhaph - Ben Duguid

Reputation: 26956

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/">

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).

Upvotes: 5

JerSchneid
JerSchneid

Reputation: 5917

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&answer=66736

Upvotes: 2

Related Questions