I’m using Google Analytics on my website and I’m wondering if it’s possible to make a Javascript call to GA to obtain certain information about the current visitor such as the persons current location.
Does GA have an on page API that allows to obtain sessions specific information?
Google Analytics does not provide data for single visitors (not via the API nor otherwise – this is a privacy thing) so the answer is no.
Besides most data in GA in drawn from the users browser anyway, so querying GA to get it would be an unnecessary roundtrip.
For location there a IP based services (for example ip2location.com) or the HTML5 geolocation API.