1
votes

I am using V3 of google analytics API and the .Net Client. I have everything working the only issue I am having is when I try to run the following

metrics: ga:visits dimensions: ga:country, ga:region, ga:city, ga:latitude, ga:longitude, ga:networkDomain, ga:networkLocation, ga:date, ga:hour

I get this error

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "Invalid Value"
   }
  ],
  "code": 400,
  "message": "Invalid Value"
 }
}

when I run the following it works metrics: ga:visits dimensions: ga:country, ga:region, ga:city, ga:latitude, ga:longitude, ga:networkDomain, ga:networkLocation

I used google's tool https://developers.google.com/analytics/devguides/reporting/core/dimsmets#cats=geonetwork,session,trafficsources,system,time,pagetracking,internalsearch to make sure my metrics and dimensions were valid. I also used the api explorer and got the same error. https://developers.google.com/apis-explorer/#p/analytics/v3/analytics.data.ga.get

I really don't know what the issue is or how to fix it.

1
Please, put your question shortly to the title. And explain it in the body, thank you. You get some error but what are you trying to do with analytics? Where are the sources? -1 hard-reading.hhh

1 Answers

2
votes

You can only query 7 dimensions at a time.

From the docs:

dimensions

(...)

  • You can supply a maximum of 7 dimensions in any query.
  • You can not send a query composed only of dimensions: you must combine any requested dimensions with at least one metric.
  • Only certain dimensions can be queried in the same query. Use the valid combination tool in the Dimensions and Metrics Reference to see which dimensions can be used together.