2
votes

I am trying to get the unique visitors per country with the Google Analytics API.

When I use the metric "ga:visitors" single I get the good unique visitors number.

When I add the dimension "ga:country", then the result is the non filtered visits per country.

So, is there any way to calculate "unique visitors" with other metrics (e.g new visits) with the dimension ga:country

Thank you for your help.

Yoann

1
Yoann, what do you mean by non-filtered? - Petr Havlik

1 Answers

1
votes

I was just able to get unique visitors by country (descending) using the Google Analytics Query Explorer.

1) Select your account/web property/profile (view)

2) Select 'ga:country' as your dimension

3) Select 'ga:visitors' as your metric

4) Select '-ga:visitors' as your metric you'd like to sort by descending

5) Click 'Get Data'