: Link to another website and track clicks on the link while also keeping the link "valuable" from a SEO point of view I want to build a small directory for programming-related websites only
I want to build a small directory for programming-related websites only and I'm a little bit confused at the moment. I want to be able to track how many times visitors clicked links to certain websites, but I still want Google to pick-up that link as being towards site X, without losing any SEO value (meaning, for Google, that link still has to look like a clean backlink, not a link to a PHP file that redirects the user to another website).
Question is, if I use jQuery to post some data (simply "link x clicked") to a PHP script beforethe default behaviour (directing the user to the page), will Google penalize the link or will it still be as valuable as a normal back-link?
Thanks all,
Claudiu
More posts by @Debbie626
3 Comments
Sorted by latest first Latest Oldest Best
A JavaScript-free way of doing this might be to use a 301 redirect. Google still passes PR when it's a 301 redirect (I'm not sure whether 302 passes PR), so if you use a 301 redirect from your tracking page, then you'll be fine. And 301 should also preserve referrer information.
Edit:
I want to elaborate on the logic of this method. As Tim noted below, this isn't actually the official use of a 301 redirect, which technically is a way for a web server to indicate that a resource has been permanently moved. Likewise, 302 is technically for indicating when a resource has been temporarily moved to a new location.
However, the 301/302 response codes have a history of being appropriated for other uses by browsers, by search engines and by developers. For example, before 303 existed, it was common to use a 302 redirect to respond to POST requests when you wanted to redirect the user to another page (ie. to prevent a page refresh resubmitting the form). This was technically not what a 302 is supposed to be used for, but due to the lack of alternatives, it was still standard practice to use 302 in this way. Today we have 303, so 302 redirects should no longer be used for this type of redirection, though many applications still do.
Another common nonstandard use of 301/302 redirects is for URL shortening. It's widely recommended for SEO purposes that, if you need to shorten a URL, you use a service that performs a 301 redirect. But technically the content hasn't been moved from the shortened URL to the destination; the shortened URL is just a new alias for it.
Still, when you choose between using JavaScript or 301 redirects for click-tracking, take the following into consideration:
Google recommends using the JavaScript method, and they're a bit of an authority on web analytics and SEO.
As Tim mentions, the JavaScript method prevents crawlers from being counted by your click tracker (though you could probably filter crawlers out another way).
Using the 301 redirection method doesn't conform with the official use of 301 laid out in the HTTP specs.
On the flip side, you do allow tracking without JavaScript.
Google does give you a way to do it. For Asynchronous tracking use the code found here, www.google.com/support/analytics/bin/answer.py?hl=en&answer=55527.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.