Hızlı başlangıç örneği

Hesabınızın son 30 gün içindeki performansını marketingMethod ve offerId etiketine göre segmentlere ayrılmış şekilde döndüren ProductPerformanceView için örnek bir sorgu aşağıda verilmiştir. Merchant Reports API'yi tanımak için bu kısa örneği deneyebilirsiniz.

Bu raporu almak için Performans ve analizler rolüne sahip olmanız gerekir. Daha fazla bilgi için gereksinimleri inceleyin.

İstekte bulunmak için aşağıdaki Merchant Center Sorgu Dili ifadesini accounts.reports.search yöntemine iletin:

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

HTTP istek URL'si

İstek, aşağıdaki URL'de Merchant Reports API sunucusuna giden bir HTTP POST'undan oluşur:

https://merchantapi.googleapis.com/reports/v1beta/accounts/parent/reports:search

Tam HTTP isteği örneği

Aşağıda, bir HTTP POST isteği içinde yer alan rapor tanımını gösteren eksiksiz bir örnek verilmiştir:

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

Aşağıda örnek bir yanıt verilmiştir:

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