日期範圍
Merchant Center 查詢語言可讓你使用自訂
或是相對日期範圍所有的指標要求都必須包含條件
WHERE
子句中的 segments.date
,表示
匯聚成效資料時
自訂日期範圍
您可以使用 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'
不是
有效的日期字串。
相對日期範圍
除了自訂日期範圍外,你還可以指定相對日期範圍,例如
使用 DURING
(而不是 BETWEEN
) 和 THIS_MONTH
,同時以 LAST_30_DAYS
或 THIS_MONTH
的身分
AND
:
WHERE segments.date DURING LAST_30_DAYS
查看
Merchant Center 查詢語言文法
查看可用相對日期範圍清單
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-08-22 (世界標準時間)。
[null,null,["上次更新時間: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"]]