Esempio di guida rapida

Ecco una query di esempio per ProductPerformanceView che restituisce il rendimento del tuo account negli ultimi 30 giorni, segmentato per marketingMethod e offerId. Puoi provare questo rapido esempio per conoscere l'API Merchant Reports.

Per recuperare questo report, devi avere il ruolo su prestazioni e approfondimenti. Per ulteriori dettagli, consulta i requisiti.

Per effettuare la richiesta, passa la seguente istruzione Lingua di query di Merchant Center al metodo accounts.reports.search:

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

URL richiesta HTTP

La richiesta è costituita da una richiesta POST HTTP al server dell'API Merchant Reports al seguente URL:

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

Esempio di richiesta HTTP completo

Ecco un esempio completo che mostra la definizione del report racchiusa in una richiesta POST 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'"
}

Ecco un esempio di risposta:

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