執行大型報表
根據預設,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
後續步驟
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-09 (世界標準時間)。
[null,null,["上次更新時間: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"]]