日期范围
借助 Merchant Center 查询语言,您可以使用自定义
或相对日期范围所有指标请求都必须包含
segments.date
(位于 WHERE
子句中),用于表示从以下时间开始统计的
您要检索效果数据
自定义日期范围
您可以使用 ISO 8601(YYYY-MM-DD) 格式指定日期:
segments.date BETWEEN '2021-01-01' AND '2021-01-31'
或者:
segments.date >= '2021-01-01' AND segments.date <= '2021-01-31'
您可以使用单引号 ('
) 或双引号定义日期字符串
("
)。但是,您必须保持一致:例如:"2021-01-01'
不是
有效的日期字符串。
相对日期范围
除了自定义日期范围外,您还可以指定相对日期范围,例如
作为 LAST_30_DAYS
或 THIS_MONTH
,使用 DURING
(而不是 BETWEEN
)和
AND
:
WHERE segments.date DURING LAST_30_DAYS
请查看
Merchant Center 查询语言语法
查看可用相对日期范围的列表。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-22。
[null,null,["最后更新时间 (UTC):2024-08-22。"],[[["The Merchant API is the new version of the Content API for Shopping and represents the future of the platform."],["All Merchant Center Query Language requests for metrics require a `segments.date` condition in the `WHERE` clause to specify the desired time period for performance data retrieval."],["Date ranges can be specified using custom ISO 8601 formatted dates or relative date ranges like `LAST_30_DAYS` using `DURING` in the `WHERE` clause."]]],["The beta version of the Merchant API, the new Content API for Shopping, is introduced. All requests for performance metrics require a `segments.date` condition in the `WHERE` clause. Dates can be specified in ISO 8601 format within a custom range using `BETWEEN` or `\u003e=` and `\u003c=`. Alternatively, relative date ranges like `LAST_30_DAYS` can be specified with `DURING`. For a list of available date ranges, the grammar documentation should be consulted.\n"]]