Berikut adalah contoh kueri ke
product_performance_view
yang menampilkan performa akun Anda selama 30 hari terakhir, yang disegmentasikan menurut
marketing_method
dan offer_id
. Anda dapat mencoba contoh cepat ini untuk
memahami Merchant Reports API.
Untuk mengambil laporan ini, Anda harus memiliki Peran performa dan insight. Untuk informasi selengkapnya, lihat Persyaratan.
Untuk membuat permintaan, teruskan pernyataan Merchant Center Query
Language berikut ke
metode
accounts.reports.search
:
SELECT
marketing_method,
offer_id,
impressions,
clicks,
click_through_rate
FROM product_performance_view
WHERE date BETWEEN '2023-11-01' AND '2023-11-30'
URL permintaan HTTP
Permintaan ini terdiri dari POST HTTP ke server Merchant Reports API di URL berikut:
https://merchantapi.googleapis.com/reports/v1beta/accounts/ACCOUNT_ID/reports:search
Contoh permintaan HTTP lengkap
Berikut adalah contoh lengkap yang menunjukkan definisi laporan yang disertakan dalam permintaan POST HTTP:
POST https://merchantapi.googleapis.com/reports/v1beta/accounts/ACCOUNT_ID/reports:search HTTP/1.1 Parameters: { "query" : "SELECT marketing_method, offer_id, impressions, clicks, click_through_rate FROM product_performance_view WHERE date BETWEEN '2023-11-01' AND '2023-11-30'" }
Berikut adalah contoh respons:
{
"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"
}
}
]
}
Untuk mengetahui informasi selengkapnya tentang kolom yang tersedia untuk kueri, lihat Kolom dalam tabel productPerformanceView
.