increase response rate to ip log
<p>I am logging visits to several of my pages to determine geographic areas of visitors. I am using the google client location api. I seems to work correctly on my development equipment. However, only a few of my visitors are actually being logged to the database. What can I do to increase the logging percentages?</p>

<pre><code>&lt;script src="http://www.google.com/jsapi" language="javascript"&gt;&lt;/script&gt;
&lt;script type="text/javascript" charset="utf-8"&gt;
if (google.loader.ClientLocation != null) {
var city = google.loader.ClientLocation.address.city;
var region=google.loader.ClientLocation.address.region;
var country=google.loader.ClientLocation.address.country;
var country_code=google.loader.ClientLocation.address.country_code;
var pagetitle=document.getElementById('pagetitle').innerHTML;
var ip = "&lt;?php echo $_SERVER['REMOTE_ADDR'];?&gt;";
var url= "&lt;?php echo $_SERVER['REQUEST_URI'];?&gt;";
$(document).ready(function() {
var data="city=" + city + "&amp;region=" + region + "&amp;country=" + country + "&amp;country_code=" + country_code + "&amp;ip=" + ip + "&amp;pagetitle=" + pagetitle + "&amp;url=" + url;
$.ajax({
    url:'somefile.php',
    type:'post',
    cache:false,
    data:data
});//end ajax
});//end doc ready
}//end if not null 
&lt;/script&gt;
</code></pre>
