I recently tried to grab the ip address of a user signing up to INRtracker.
My strategy was to use some back end PHP code to grab the ip address and then insert it into one of our MySQL tables.
However, I ran into some trouble.
When I used $_SERVER, the code would run.
But nothing would go into the MySQL table.
ip2long is the answer
Then I thought, maybe it's because I'm using varchar for the MySQL column structure. So instead I decided to change the structure of the column to an unsigned integer.
But, I had to convert the ip into an integer, so I did a quick search on Google before I started coding away – and I found this post: http://daipratt.co.uk/mysql-store-ip-address/ that shows how to do this with a PHP function called ip2long.
Why Internal Tracking Is Important
The purpose of keeping track of the ip address of registered users on INR Tracker is to learn how and when users are using our website.
Google Analytics in my opinion is only one part of the puzzle.
wWen you want to track stats for when your users are logged into your site, it's best to do it on your own.
My business partner came up with this as part of our product management strategy.
This way we can figure out what parts of the site we should dedicate our time toward and what parts we should possibly drop.
If everyone's using one part of the site, then we know we should improve that more.
Consequently, if everyone's not using another part of the site, then we know we shouldn't waste our time on improving that part of the site.