Dưới đây là truy vấn mẫu cho ProductPerformanceView
trả về hiệu suất tài khoản của bạn trong 30 ngày qua, được phân đoạn theo marketingMethod
và offerId
. Bạn có thể thử ví dụ nhanh này để làm quen với API Báo cáo của người bán.
Bạn cần có vai trò Hiệu suất và thông tin chi tiết để truy xuất báo cáo này. Vui lòng xem các yêu cầu để biết thêm thông tin chi tiết.
Để đưa ra yêu cầu, hãy chuyển câu lệnh sau đây Ngôn ngữ truy vấn của Merchant Center vào phương thức accounts.reports.search
:
SELECT
marketingMethod,
offerId,
impressions,
clicks,
clickThroughRate
FROM ProductPerformanceView
WHERE date BETWEEN '2020-11-01' AND '2020-11-30'
URL yêu cầu HTTP
Yêu cầu này bao gồm một yêu cầu POST qua HTTP gửi tới máy chủ API Báo cáo của người bán tại URL sau:
https://merchantapi.googleapis.com/reports/v1beta/accounts/parent/reports:search
Mẫu yêu cầu HTTP hoàn tất
Dưới đây là một ví dụ đầy đủ cho thấy định nghĩa báo cáo kèm theo yêu cầu POST qua HTTP:
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'" }
Dưới đây là câu trả lời mẫu:
{
"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"
}
}
]
}