试用 Google Analytics 的 MCP 服务器。从
GitHub 安装,并参阅
公告了解详情。
DateRange
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
一组连续的日子:startDate
、startDate + 1
、...、endDate
。请求最多可以包含 4 个日期范围。
JSON 表示法 |
{
"startDate": string,
"endDate": string,
"name": string
} |
字段 |
startDate |
string
查询的开始日期(含此日期),格式为 YYYY-MM-DD 。不得晚于 endDate 。也接受 NdaysAgo 、yesterday 或 today 格式,在这种情况下,系统会根据媒体资源的报告时区推断日期。
|
endDate |
string
查询的结束日期(含此日期),格式为 YYYY-MM-DD 。不能早于 startDate 。也接受 NdaysAgo 、yesterday 或 today 格式,在这种情况下,系统会根据媒体资源的报告时区推断日期。
|
name |
string
为此日期范围分配名称。报告响应中的维度 dateRange 的值为此名称。如果设置,则不能以 date_range_ 或 RESERVED_ 开头。如果未设置,日期范围将按请求中的从零开始的索引命名:date_range_0 、date_range_1 等。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eDefines a contiguous set of days using \u003ccode\u003estartDate\u003c/code\u003e and \u003ccode\u003eendDate\u003c/code\u003e for querying data within a specific timeframe.\u003c/p\u003e\n"],["\u003cp\u003eAllows requests for up to 4 date ranges, providing flexibility in data retrieval.\u003c/p\u003e\n"],["\u003cp\u003eUses a JSON representation with fields for \u003ccode\u003estartDate\u003c/code\u003e, \u003ccode\u003eendDate\u003c/code\u003e, and an optional \u003ccode\u003ename\u003c/code\u003e for the date range.\u003c/p\u003e\n"],["\u003cp\u003eAccepts date formats in \u003ccode\u003eYYYY-MM-DD\u003c/code\u003e or relative formats like \u003ccode\u003eNdaysAgo\u003c/code\u003e, \u003ccode\u003eyesterday\u003c/code\u003e, or \u003ccode\u003etoday\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEnables assigning custom names to date ranges or uses default naming based on their index in the request.\u003c/p\u003e\n"]]],["The core content describes defining date ranges for queries. Each date range is specified by a `startDate` and `endDate` in `YYYY-MM-DD` format or using relative terms like `NdaysAgo`, `yesterday`, or `today`. A `name` can be assigned to each range, which will be used in the response; otherwise, ranges are indexed. Up to four date ranges can be requested. The `startDate` cannot be after `endDate`, and the `name` cannot begin with `date_range_` or `RESERVED_`.\n"],null,["# DateRange\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n\nA contiguous set of days: `startDate`, `startDate + 1`, ..., `endDate`. Requests are allowed up to 4 date ranges.\n\n| JSON representation |\n|--------------------------------------------------------------------|\n| ``` { \"startDate\": string, \"endDate\": string, \"name\": string } ``` |\n\n| Fields ||\n|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `start``Date` | `string` The inclusive start date for the query in the format `YYYY-MM-DD`. Cannot be after `endDate`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property's reporting time zone. |\n| `end``Date` | `string` The inclusive end date for the query in the format `YYYY-MM-DD`. Cannot be before `startDate`. The format `NdaysAgo`, `yesterday`, or `today` is also accepted, and in that case, the date is inferred based on the property's reporting time zone. |\n| `name` | `string` Assigns a name to this date range. The dimension `dateRange` is valued to this name in a report response. If set, cannot begin with `date_range_` or `RESERVED_`. If not set, date ranges are named by their zero based index in the request: `date_range_0`, `date_range_1`, etc. |"]]