tags:

views:

37

answers:

3

I want to redirect users that arrive at my root url to another page that contains the referring site in the url, so that I can track which sources provide the most sales.

So if a user arrives at mysite.com from google, they will be redirected (using php header function) to mysite.com/page.php?ref=google.com. That way, I can see in my referral stats which search-engines are providing the most converting customers.

I already know how to do this, but my question is this: What would google and other search engines think of this? Would my search rankings suffer as a result of using a redirect? If so, how else can I achieve my aim?

Any help appreciated as always.

UPDATE: I'm tracking affilate sales. So the referral stats come from the sites I advertsise.

CONCLUSION: three helpful answers. Shame I can only accept one. Thanks guys.

+2  A: 

Redirects in general are fine when used properly, but I'm not sure I understand your question. This seems like an unnecessary use of a redirect. Your analytics software should already be able to access the referrer without having to append it to the query string first - if not, get a new analytics setup!

Matchu
So, technically, I can use header function without problem? Also, it's affilate sales I'm tracking so the referral stats come from the sites I advertise.
Steven
@Steven - I still don't quite get it... are you passing your users to other websites, and want those *other* sites to know how users got to *your* site? At any point that you can see the referrer to add it to the query string, you can just log it, instead. Anyway, I really don't know to what extent Google punishes seemingly frivolous redirects, but you should probably be good to go... even so, I'm still not sure that you really need that...
Matchu
Yes that's it. I will then know where my conversions mostly come from and as you say, the advertiser will know too. However, now that i think about it , I'm not sure i want that!!
Steven
A: 

PHP redirect does a 302.

I have used it for one of my domain enroller.in --> enroller.in/a/ . AFAIK search engine ranking on Google is not affected and my site is on the first page for our keywords. In search results it always shows original url.

Ankit Jain
Thanks. I looked up your site on google and it confirms what you said. Great stuff.
Steven
Out of interest tho, why redirect to /a?
Steven
A: 

Search engines SHOULD interpret the status codes sent along with the redirect like this:

  • 302 = Temporary means the URL initially recorded is okay and should be listed in search results, just use the content of the target site for index

  • 301 = Permanent means the URL is actually wrong, use the target URL for search results

So it depends on which URL you want to show up in search results. I assume you want the default 302 in this particular case. If not, use

header("HTTP/1.1 301 Moved Permanently");
header("Location: X");
korkman
Let me see if I get this. So if I use a 302, will the search engine analyse the content of the original page or the page it redirects to?
Steven
In both cases the content from the target page is used. There is nothing else to index. Unless there once was content at the initial URL, which is where things can get ambigious an dangerous if 302 is used because search engine may think there are two pages, both having same content.
korkman
BTW from your description I suspect you don't need to worry about search engines anyway, because you're redirecting visitors based on HTTP referer? Search engines won't send HTTP referers containing their names. They only send user-agents.
korkman
@korkman good to know - thanks.
Steven