Traffic stats category archive

December 3rd, 2006 | Filed under Tutorials, Google Analytics

Here’s a handy tip on how to track broken links or missing pages on your site with Google Analytics. Speaking of, here’s how we use Analytics at Lifehacker to figure out which posts are our top performers.


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]

Server log IP resolution

September 1st, 2005 | Filed under Code snippets, Traffic stats, Apache web server

Apache’s Logresolve is a little utility translates all those IP addresses in your server logs into English, ie displays 67.19.139.26 as ginatrapani.org. Before my host resolved this site’s logs for me, this batch file on my Windows box resolved logs named something.log and saved them in a folder named “resolved”:

for %%F in (*.log) do "c:/program files/apache group/apache2/bin/logresolve" < %%F > resolved/%%F