下方對 ProductPerformanceView
的查詢範例會傳回過去 30 天的帳戶成效,並以 marketingMethod
和 offerId
區隔。您可以透過這個簡短的範例熟悉 Merchant Reports API。
您必須具備成效與深入分析角色,才能擷取這份報表。詳情請參閱相關規定。
如要提出要求,請將下列 Merchant Center Query Language 陳述式傳遞至 accounts.reports.search
方法:
SELECT
marketingMethod,
offerId,
impressions,
clicks,
clickThroughRate
FROM ProductPerformanceView
WHERE date BETWEEN '2020-11-01' AND '2020-11-30'
HTTP 要求網址
這項要求會將 HTTP POST 傳送至位於下列網址的 Merchant Reports API 伺服器:
https://merchantapi.googleapis.com/reports/v1beta/accounts/parent/reports:search
完整的 HTTP 要求範例
以下是完整範例,顯示在 HTTP POST 要求中的報表定義:
POST /reports/v1beta/accounts/parent/reports:search HTTP/1.1 Host: merchantapi.googleapis.com User-Agent: curl Content-Type: application/json Accept: application/json Authorization: Bearer Parameters: { "query" : "SELECT marketingMethod, offerId, impressions, clicks, clickThroughRate FROM ProductPerformanceView WHERE date BETWEEN '2020-11-01' AND '2020-11-30'" }
回應範例如下:
{
"results": [
{
"productPerformanceView": {
"marketingMethod": "ADS",
"offerId": "12345",
"clicks": "38",
"impressions": "1038",
"clickThroughRate": "0.3661"
}
},
{
"productPerformanceView": {
"marketingMethod": "ADS",
"offerId": "12346",
"clicks": "126",
"impressions": "1126",
"clickThroughRate": "0.1119"
}
},
{
"productPerformanceView": {
"marketingMethod": "ORGANIC",
"offerId": "12346",
"clicks": "26",
"impressions": "526",
"clickThroughRate": "0.0494"
}
},
{
"productPerformanceView": {
"marketingMethod": "ADS",
"offerId": "12347",
"clicks": "227",
"impressions": "1227",
"clickThroughRate": "0.1850"
}
},
{
"productPerformanceView": {
"marketingMethod": "ORGANIC",
"offerId": "12347",
"clicks": "12",
"impressions": "512",
"clickThroughRate": "0.0234"
}
}
]
}