DISQUS

DISQUS Hello! Newest Industry is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Newest Industry

Chronicles of a Crazy Canuck
Jump to original thread »
Author

Hit Tracking with PHP and MySQL

Started by Stephen Pierzchala · 10 months ago

Recently there was an outage at a hit-tracking vendor I was using to track the hits on my externally hosted blog, leaving me with a gap in my visitor data several hours long. While this was an inconvenience for me, I realized that this could be mission critical failure to an online business reli ... Continue reading »

4 comments

  • Why do you convert the IP using ip2long - are there any benefits to it?
  • Using ip2long is a holdover from my Geographic IP Database, where performing IP searches was far easier with a numeric value than an IP address. Most application development languages have a way to convert these numbers back to IPs quickly. As well, this conversion can occur natively in MySQL SELECT statements.

    You could add a column to the database table that added the raw IP address with very little change to the method described in this article.
  • What about scalability issues? The database size will expand quickly with traffic and it adds another hit on the server with each page load.
  • This is definitely a solution for a small web site, and was designed to be small and light.

    I started using this more when I was hosting my blog outside of the tracking infrastructure, so there is no increase in traffic on either infrastructure.

    Steps could also be taken to aggregate the data based on patterns in the data and then archive the raw results outside the DB.

    Many ways this can be improved upon. But it gets folks thinking.

Add New Comment

Returning? Login