指定日期範圍
相對日期範圍
報表查詢提供 date_range
欄位,用於指定要納入哪些日期的資料
顯示報表中的資料您可以為 date_range
指定下列值:
TODAY
YESTERDAY
MONTH_TO_DATE
YEAR_TO_DATE
LAST_7_DAYS
LAST_30_DAYS
CUSTOM
請注意,如未指定,預設日期範圍為 CUSTOM
。
自訂日期範圍
當 date_range
設為 CUSTOM
或
未指定,您必須將 start_date
和 end_date
設為
報表範圍內的開始和結束日期。
在 API 請求的查詢參數中,開始日期參數如下所示:
startDate.year=2021&startDate.month=3&startDate.day=1
同樣地,結束日期參數看起來會像這樣:
endDate.year=2021&endDate.month=3&endDate.day=3
後續步驟
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-08-29 (世界標準時間)。
[null,null,["上次更新時間:2024-08-29 (世界標準時間)。"],[[["AdSense report queries use a `date_range` field to specify the timeframe for included data, accepting values such as `TODAY`, `YESTERDAY`, or various relative ranges."],["For custom date ranges, set `date_range` to `CUSTOM` and specify the inclusive start and end dates using `start_date` and `end_date` parameters."],["Custom start and end dates are defined by separate parameters for year, month, and day, formatted like `startDate.year=2021&startDate.month=3&startDate.day=1`."]]],["Report queries utilize a `date_range` field to define data inclusion periods. Available options are `TODAY`, `YESTERDAY`, `MONTH_TO_DATE`, `YEAR_TO_DATE`, `LAST_7_DAYS`, `LAST_30_DAYS`, and `CUSTOM`. The default is `CUSTOM`. When `CUSTOM` is used, `start_date` and `end_date` parameters are mandatory, set via `startDate.year`, `startDate.month`, `startDate.day` and `endDate.year`, `endDate.month`, `endDate.day` in the API request query.\n"]]