เรียกใช้รายงานขนาดใหญ่
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
รายงานมีความยาวได้ไม่เกิน 100,000 แถวใน AdSense Management API โดยค่าเริ่มต้น หากคุณ
ใกล้ถึงขีดจำกัดเหล่านี้ หรือประสบปัญหาด้านประสิทธิภาพขณะประมวลผลข้อมูล
เป็นเคล็ดลับที่อาจช่วยได้
การลดขนาดรายงาน
สิ่งแรกที่ต้องมองหาเมื่อจะทำให้รายงานมีขนาดเล็กลงคือ รายการมิติข้อมูลที่คุณ
การใช้; มิติข้อมูลแต่ละรายการที่คุณเพิ่มจะมีผลคูณกับจำนวนแถวที่แสดงผล ตรวจสอบว่า
เพียงเพิ่มมิติข้อมูล
ที่คุณต้องการเท่านั้น
การแยกรายงาน
บางครั้งต้องการเพียงข้อมูลที่แม่นยำมากสำหรับบางส่วนของรายงาน โดยที่ข้อมูลที่เหลือ
จึงให้รายละเอียดน้อยลง ตัวอย่างเช่น คุณอาจต้องการรายละเอียด
ที่แม่นยำอย่างยิ่งสำหรับ
กับรายได้ในแต่ละเดือน พร้อมสถิติตามประเทศและช่องในทุกๆ วัน
แต่จริงๆ แล้วต้องการ
ระดับประเทศเมื่อดูก่อนหน้านั้น ดังนั้น คุณสามารถเรียกใช้รายงานที่ซับซ้อน
ของเดือนก่อนหน้า แต่เป็นรายการที่ง่ายกว่าสำหรับช่วงเวลาก่อนหน้านั้น
หลีกเลี่ยงการแยกวิเคราะห์ JSON โดยการเปลี่ยนไปใช้ CSV
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 Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eAdSense Management API reports have a default maximum length of 100,000 rows, and exceeding this limit may cause performance issues.\u003c/p\u003e\n"],["\u003cp\u003eMinimizing the number of dimensions used in a report can significantly reduce its size and improve performance.\u003c/p\u003e\n"],["\u003cp\u003eFor reports requiring varying levels of granularity, consider splitting them into multiple reports with different dimension sets to optimize data retrieval.\u003c/p\u003e\n"],["\u003cp\u003eSwitching from JSON to CSV format for report retrieval can avoid JSON parsing overhead and improve efficiency.\u003c/p\u003e\n"]]],["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"],null,["# Run Large Reports\n\nReports have a maximum length of 100,000 rows in the AdSense Management API, by default. If you're\nrunning close to these limits, or running into performance issues while processing the data, here\nare some tips that may help.\n\nReducing the scale of your report\n---------------------------------\n\nThe first thing to look for when trying to make a report smaller is the list of dimensions you're\nusing; each dimension you add has a multiplicative effect on the number of returned rows. Make sure\nyou only add the dimensions you need!\n\nSplitting your reports\n----------------------\n\nSometimes, you only need extremely accurate data for a portion of the report, with the rest\nallowing for less detail. For example, you could need extremely accurate details for the previous\nmonth's earnings, with stats per country and channel across every day, but only really need the\ncountry-level data when looking before that. You could therefore run a complex report for the\nprevious month, but a simpler one for the time before that.\n\nAvoid JSON parsing by switching to CSV\n--------------------------------------\n\nThe AdSense Management API allows you to receive your reports in CSV format, rather than the usual JSON.\n\nTo do that, simply call the alternate [generateCsv](/adsense/management/reference/rest/v2/accounts.reports/generateCsv) method.\n\n#### Example\n\n```\nDATE,CLICKS\n2014-01-01,2\n2014-01-02,1\n2014-01-03,4\n2014-01-04,1\n2014-01-05,1\n```\n\nNext steps\n----------\n\n- [Batching](/adsense/management/reporting/batching)\n- [Using Multiple Dimensions Wisely](/adsense/management/reporting/dimensions_metrics#usingmultiple)"]]