I have code running on all of my sites that attempts to reverse the DNS for each IP that visits. This uncovers the organization for many visitors but unfortunately it still leaves a lot of IPs that don't have corresponding DNS entries.

There's a public database of who owns what IP address. Using two ARIN WHOIS API calls (shown below) you can pull the organization and address for every IP (usually the address of an ISP). This can be used to replace random numbers (e.g. with entries like "GONET (Ministry of Government Services, Infrastructure Technology Services)" and "Alberta PWSS, Telecommunications Division (10365 - 107 Street)".


The parameters are shown below, encapsulated by curly brackets.


http://whois.arin.net/rest/org/{ARIN Organization Handle, obtained through XML result from API call above}

PHP code for looking up IP owners: