Monitor data connection based on location constantly I was wondering if there was way to ping google.com (or any other stable site) and record my GPS location. It would then append the result of the ping, GPS position, and the time to a log file on my phone. It would run every 10 seconds or so. 

Basically, I just want to get a view of my phone's Internet connection throughout the day and at different times. After a full day running, I could then look at the generated log and figure out all sorts of interesting analytics for my phone.

Is it possible, perhaps using apps, script, or anything?
There are no apps appear to suit to your need. But you could use two separate apps to do what you need to do. 

Use Googles My Tracks to record your location data automatically. This app,


Record data of where you are using GPS coordinates. 
Allows you to monitor your trip or the places of visits in 3D maps. 
Promotes easy sharing of your data. 


Use Traffic Counter to monitor your data usage. This app,


Records your data usage details real time
Offer some good in-app analysis tools
Can be used to monitor calls, SMSs, WiFi, apps, etc. as well


With the help of these two, you can achieve your objective. No need to ping a site!