מדריך למתחילים

זוהי שאילתת לדוגמה ל-product_performance_view שמציגה את ביצועי החשבון ב-30 הימים האחרונים, לפי פילוח לפי marketing_method ו-offer_id. אתם יכולים לנסות את הדוגמה המהירה הזו כדי להתנסות ב-Merchant Reports API.

כדי לאחזר את הדוח הזה, צריכה להיות לכם הרשאת 'ביצועים ותובנות'. מידע נוסף זמין במאמר דרישות.

כדי לשלוח את הבקשה, מעבירים את ההצהרה הבאה בשפת השאילתות של Merchant Center לשיטה 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 של בקשת ה-HTTP

הבקשה מורכבת מבקשת HTTP POST לשרת של Merchant Reports API בכתובת ה-URL הבאה:

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

דוגמה לבקשת HTTP מלאה

לפניכם דוגמה מלאה שמראה את הגדרת הדוח בתוך בקשת HTTP POST:

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

זוהי דוגמה לתגובה:

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

מידע נוסף על השדות שזמינים לשאילתות זמין במאמר שדות בטבלה productPerformanceView.