Hi Bob,
We're improving a lot of the underlying technology in Shopify for tracking visits. Opening this up in the API is something we will be looking into.
In the meantime, you can do as Ben said regarding the ScriptTag resource, and another option is to use the Google Analytics API (if the store has Google Analytics enabled).