Say I have a domain set up and the index.php uses header("Location: http://my.affiliate.site") Is there any way to track hits to that with google analytics? Mostly I just want to know where traffic is coming from. Thanks, Joe
Somewhere along the line something stores the referrer. I think it's Apache on the last stop. So if you click a link at a.com which redirects you to b.com then Apache at b.com will store the referrer somewhere. I know this because I have used a traffic monitor named Webalizer which stores this data. Regards,
You have 2 ways: 1. Use Apache and see HTTP referrers. You can use any statistic software (webalizer, awstat etc). 2. You can use php code and save $_SERVER['HTTP_REFERER'] variable to file or database and after this analyze this information
My host provides webalizer and awstats, but these hits aren't tracking in the Referrals section. It just lists the number of visitors who were 301'd to another site. In my php if the index.php is just one line: header(Location: xxx); Can I stick a line before that that stores HTTP_REFERRER in a file?
If AWStats cannot read the referrer, I doubt a PHP script could. Another idea is to use unique links for each affiliate, something like "Location: http://my.affiliate.site/?from=1234". Jean-Luc
I have a unique link with tracking ID for the affiliate link, but I still can't figure where the traffic is coming from. The other deeper pages on the domain are being tracked just fine, but the pure redirect is not.