View live site referers

September 6th, 2005 | Filed under PHP, MySQL, Essential Tools, Traffic stats

Programmer Dean Allen’s free PHP/MySQL app, Refer, displays live real-time referring URLs to your web site.

Of course, one could just watch one’s site logs to get an idea of who’s clicking in from where. But Refer filters out certain types of files (CSS, JS, etc), referers from your own domain, and can exclude certain directories, too. (Like, I don’t want to see any referers generated while I’m working on a post in WordPress.)

I’ve used Refer for several months now on my other site, and besides occassional referer spam problems, it’s a fantastic way to see immediately if your site is getting a whole lot of traffic from fresh links.

The downside of Refer is that it requires a database insert on EVERY request for pages for which you want referers recorded. This can slow things down considerably, and perhaps give your conservative performance-concerned sysadmin indigestion. Refer uses this neat .htaccess line which automatically adds the PHP script to the end of each page for processing:

php_value auto_prepend_file /www/ginatrapani/refer/refer.php

Not sure how long I’ll keep this unpassworded, but here’s Spun’s installation of Refer so you can check out how it works yourself..

Refer 2.1 [Textism]