Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I was asked to introduce a unified self hosted URL-Shortener/Forwarder/Tracking Service for an website that earns money from affiliates. One example I found was one of the bigger german sites for bargains. (mydealz)

So I had a look at their way of doing it, and I was quite surprised.

From my point of view, the only sensible way to do the forwarding and tracking is using a PHP header redirect, if 301 or 302 in my eyes is mainly a question wether you want to double track double links or not.

But they do the forward using a small page using javascript window.location.href. But why?

Screenshot MyDealz forwarder

Is there any advantage that I don't see? Are there any disadvantages of the PHP redirect?

As far I as tested no referer are lost while using header redirect.

Thanks in advance for your help.

share|improve this question

2 Answers 2

I always lean towards a server side redirect for this sort of thing as well. The only possible disadvantage I could see (though I don't consider it one) is that by using server side 301's your affiliate links aren't likely to get indexed in Google. If you don't care about getting your redirect links indexed then it seems to me that a server side redirect is much more reliable and makes a lot more sense in the case you presented.

share|improve this answer
    
I totally agree with you. That's why I was surprised to see them doing it that way. –  Christoph Daum Jun 26 at 21:39
    
@ChristophDaum the only reason I can think of for them to do this is to get them indexed. –  Josh Mountain Jun 26 at 21:41
    
Sure true. But those pages don't have any real content. Unless they do black hat and deliver different content to google. I'll check that tomorrow. But even if not. Google doesn't like these kind of forwards as far as I know. And it's at least a grey hat Seo method. Correct me if I'm wrong on that point. –  Christoph Daum Jun 26 at 21:47
    
You are correct, I'd stick with server side redirects unless you have some very specific reason not to. –  Josh Mountain Jun 26 at 21:56
    
I've just checked that. And look what I found in the robots.txt User-agent: * Allow: / Disallow: /visit. So it's not about being indexed. –  Christoph Daum Jun 27 at 6:19
up vote 0 down vote accepted

I just found the solution myself. There is no way to modify the referer using PHP, as this is being sent by the browser. The script I posted above is basically the same script, just without Step 1, posted by @honyovk on Stackoverflow in this topic. http://stackoverflow.com/questions/6428762/hide-referrer-on-click/11249553#11249553

And probably the idea is to make sure that if someone shares the link, it still sets the correct referrer to ensure that an affiliate network relying on refferer still tracks the sale/lead/click to the right account.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.