我正在尝试从GA API访问12个维度。
当我对6-7个参数执行相同操作时,效果很好。
我搜索了限制和配额,但找不到任何东西
关于这个。



com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
  "code" : 400,
  "errors" : [ {
    "domain" : "global",
    "message" : "Requested 12 dimensions; only 7 are allowed.",
    "reason" : "badRequest"
  } ],
  "message" : "Requested 12 dimensions; only 7 are allowed."
}
    at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:145)
    at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
    at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:312)
    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1049)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
    at com.tomvogten.analytics.View.readData(View.java:165)
    at com.tomvogten.analytics.Downloader.main(Downloader.java:85)
Exception in thread "main" java.lang.NullPointerException
    at com.tomvogten.analytics.View.writeData(View.java:191)
    at com.tomvogten.analytics.Downloader.main(Downloader.java:86)
Java Result: 1

最佳答案

不幸的是,documentation中明确规定了一个限制:

“任何查询中最多可以提供7个维度。”

这就是为什么您的请求被拒绝的原因。

关于java - Google Analytics Java API:最多只能访问7个维度,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32537195/

10-13 04:15