Take a look at a common use case: summarizing the performance of your account
over the last 30 days segmented by program
and offer_id
. The query for this
report will be as follows:
SELECT
segments.program,
segments.offer_id,
metrics.impressions,
metrics.clicks,
metrics.ctr
FROM MerchantPerformanceView
WHERE segments.date BETWEEN '2020-11-01' AND '2020-11-30'
To issue this request, simply pass the Merchant Center Query Language statement
above to the reports.search
method.
HTTP request URL
The request consists of an HTTP POST to the Content API for Shopping server at the following URL:
https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/reports/search
Complete HTTP request sample
Here is a complete example showing the report definition above enclosed within an HTTP POST request:
POST /v2.1/{merchant_id}/reports/search HTTP/1.1
Host: shoppingcontent.googleapis.com
User-Agent: curl
Content-Type: application/json
Accept: application/json
Authorization: Bearer [Enter OAuth 2.0 access token here]
developer-token: [Enter developerToken here]
Parameters:
{
"query" : "SELECT segments.program, segments.offer_id, metrics.impressions,
metrics.clicks, metrics.ctr
FROM MerchantPerformanceView
WHERE segments.date BETWEEN '2020-11-01' AND '2020-11-30'"
}