ตัวอย่างการเริ่มต้นอย่างรวดเร็ว

ต่อไปนี้คือตัวอย่างการค้นหา ProductPerformanceView ที่แสดงประสิทธิภาพของบัญชีในช่วง 30 วันที่ผ่านมาซึ่งแบ่งกลุ่มตาม marketingMethod และ offerId คุณสามารถลองดูตัวอย่างสั้นๆ นี้เพื่อทำความคุ้นเคยกับ Merchant Reports API

คุณต้องมีบทบาทประสิทธิภาพและข้อมูลเชิงลึกจึงจะเรียกข้อมูลรายงานนี้ได้ ดูรายละเอียดเพิ่มเติมได้ในข้อกำหนด

หากต้องการส่งคำขอ ให้ส่งคำสั่งภาษาสำหรับการค้นหาของ Merchant Center ไปยังเมธอด accounts.reports.search

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

URL คำขอ HTTP

คำขอประกอบด้วย HTTP POST ไปยังเซิร์ฟเวอร์ Merchant Reports API ที่ URL ต่อไปนี้

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