I can embed Geo IP based tracking on your existing custom PHP websites. This will be standalone installation and do not require 3rd party web services. Your own software will convert any IP address to city and country.
I shall use maxmind database for this.
For more details you can see : http://dev.maxmind.com/geoip/legacy/geolite