How to passively track file downloads
Keeping track of web site visitors is trivially easy especially with services like Google Analytics. I enjoy elaborate graphs, charts, and content drill-down statistics as much as the next person, but such applications can occasionally go beyond the scope of what I need, or don’t provide the type of detail I’m looking for with regard to certain information.
For example, I like to keep track of download trends for certain utilities I’ve made available online. Setting up my own tracking system has made it trivially easy to tailor the data such that I can get a glimpse at reports more relevant to what I want. After all, I define the database so I can tailor the schema against the type of queries I’m going to want to run on it in the future.
In this post, I’ll explain how I setup a simple, passive system for recording file downloads in my own database. The article is based on my own experience and is targeted at Apache, PHP, and MySQL, but the techniques are [or at least should be] platform agnostic.