问题
How to find out the Referers host?
My Problem is, i wont to check, is user from google adwords or organic search... so i checking refferer, but the refferer ist allways google organix search... if some one have a be´tter idea :) tell it.
But I found out, that the HOst is a speacial one! So now I wont to check for Host of the Refferes site.
Is there a way to find out the referer is "google Adwords" ?
回答1:
Can you explain further? You want to grab the referrer? Just use
$_SERVER['HTTP_REFERER']
and then use
stristr($haystack , $needle)
to compare if they came from organic or adwords (with known values for the two)Blockquote
回答2:
Referrer data, as you've experienced, can be untrustworthy as a whole. If you're simply looking for statistical data to measure reference sources, might I suggest using Google Analytics?
http://www.google.com/analytics/
If you're trying to build logic into your PHP script based upon referrer... you might be hard pressed to find a perfect solution but here's a previous post that deals with the same topic:
Determining Referer in PHP
来源:https://stackoverflow.com/questions/2797704/host-of-referer