简体   繁体   English

谷歌分析API限制

[英]google analytics api limit

I am trying to download number of sessions in Java for time period twice a month using a loop. 我试图使用循环每月两次在Java中下载会话数。

Results are imported into a SQL database. 结果被导入到SQL数据库中。

Download in Java is executed here: Java下载在这里执行:

private static GaData getResults(Analytics analytics, String profileId) throws IOException {
    return analytics.data().ga().get("ga:" + "000000000", //example id
    Var.str_startDate,
    Var.str_endDate,
    "ga:sessions")
    .setSegment("gaid::" + Var.arrayAdvanceSegmentID_traffic[Var.loop_arrayAdvanceSegment_traffic])
    .setMaxResults(100000)
    .execute();
  }

Loop should execute code above ten times for ten different segments, but after the seventh loop I get the error messages: 循环应该为十个不同的段执行十次以上的代码,但是在第七次循环之后,我得到了错误消息:

Error: 8 Error: 9 错误:8错误:9

Until seventh round of the loop data is downloaded correctly. 直到第七轮循环数据正确下载为止。

Does anyone know what this error means and why the download for the last two rounds of the loop fails? 有谁知道此错误的含义,以及为什么最后两轮循环下载失败?

Is this maybe due to capping of Google Analytics API traffic? 这可能是由于Google Analytics(分析)API流量上限造成的吗?

I can not find any information on these error mesages in Java. 我在Java中找不到有关这些错误消息的任何信息。

I have found the answer: 我找到了答案:

In one query maximum of 7 dimensions can be downloaded, according to Core Reporting API - Reference Guide. 根据Core Reporting API-参考指南,一次查询最多可下载7个维度。

https://developers.google.com/analytics/devguides/reporting/core/v3/reference https://developers.google.com/analytics/devguides/reporting/core/v3/reference

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM