Page 1 of 1

Tracking non-direct referrals

Posted: Sun Apr 24, 2011 11:52 am
by stubarny1
Hello,

I think this is a bit of a tricky one...

If someone posts my product's name "SuperWidget" in a forum discussion and then someone does a google search for "SuperWidget" to get to my site, how can i track which forum (and ideally which thread) the visitor initially started from (i.e. not the search engine url)?

It would be great to know so that I can get a great overview of the communities that are interested in my product.

Thanks for your help,

Stu

Re: Tracking non-direct referrals

Posted: Sun Apr 24, 2011 7:36 pm
by superdezign
The only way to know where a user has come from in order to reach your site is the referrer header sent to your server, accessible through PHP's $_SERVER superglobal array. The index is "HTTP_REFERER". If the user's browser does not inform your server of their referrer, then you have no way of knowing where they came from without referral codes or some similar mechanism.