生成大型报告
默认情况下,AdSense Management API 中的报告最长可达到 100,000 行。如果您
或是在处理数据时遇到性能问题
这些提示可能对您有所帮助
缩小报告规模
尝试缩小报告时,首先要看的是您常用的维度列表
使用;您添加的每个维度都会对返回的行数产生乘积效应。请确保
您只需添加所需的维度即可!
拆分报告
有时,您只需要报告某一部分的极准确数据,其他部分
从而减少细节例如,您可能需要获得非常准确的上
以及每个国家/地区和频道每天的统计信息,但只需要
国家/地区一级的数据因此,您可以针对
但之前的版本更简单。
改用 CSV 来避免 JSON 解析
AdSense Management API 允许您以 CSV 格式接收报告,而不是常规的 JSON。
为此,只需调用备用的 generateCsv 方法即可。
示例
DATE,CLICKS
2014-01-01,2
2014-01-02,1
2014-01-03,4
2014-01-04,1
2014-01-05,1
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-09。
[null,null,["最后更新时间 (UTC):2024-09-09。"],[[["AdSense Management API reports have a default maximum length of 100,000 rows, and exceeding this limit may cause performance issues."],["Minimizing the number of dimensions used in a report can significantly reduce its size and improve performance."],["For reports requiring varying levels of granularity, consider splitting them into multiple reports with different dimension sets to optimize data retrieval."],["Switching from JSON to CSV format for report retrieval can avoid JSON parsing overhead and improve efficiency."]]],["To manage large AdSense reports, reduce the scale by minimizing the number of dimensions used, as each dimension increases rows. Split reports into detailed and less detailed sections based on data accuracy needs. For improved performance, switch from JSON to CSV format by using the `generateCsv` method. Consider batching and optimizing dimension usage for further improvements.\n"]]