빠른 시작 예

다음은 ProductPerformanceView에 대한 샘플 쿼리로, marketingMethodofferId별로 분류하여 지난 30일간의 계정 실적을 반환합니다. 간단한 예시를 통해 Merchant Reports API를 익히면 됩니다

이 보고서를 검색하려면 성능 및 통계 역할이 필요합니다. 자세한 내용은 요구사항을 참고하세요.

요청을 수행하려면 다음 판매자 센터 쿼리 언어 문을 accounts.reports.search 메서드에 전달합니다.

SELECT
  marketingMethod,
  offerId,
  impressions,
  clicks,
  clickThroughRate
FROM ProductPerformanceView
WHERE date BETWEEN '2020-11-01' AND '2020-11-30'

HTTP 요청 URL

요청은 다음 URL에서 판매자 보고서 API 서버에 대한 HTTP POST로 구성됩니다.

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"
      }
    }
  ]
}