Can we use Google Analytics API to retrieve location in code?

ashish1dev picture ashish1dev · Jul 19, 2013 · Viewed 7.5k times · Source

can i use Google Analytics API in my php or javascript code to find the location of visitor of my website ? this link talks about API, but nothing about location of visitor. https://developers.google.com/analytics/devguides/platform/features/experiments-overview

Answer

Eike Pierstorff picture Eike Pierstorff · Jul 20, 2013

Here is a complete list which dimension and metrics are supported by the GA API: https://developers.google.com/analytics/devguides/reporting/core/dimsmets#cats=visitor,geo/network. You want to look at Geo/Network (and just in case you are asking if you can have geo inforation in realtime on your website from the API, no, GA does not support that). Note that not all combinations of dimensions and metrics are allowed.