เมตริกเกณฑ์
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ใน Google Ads API รายงานเกณฑ์แต่ละรายการจะแสดงด้วยทรัพยากรแยกต่างหาก
เว้นแต่จะจำเป็น *_view
ทรัพยากรจะมีเฉพาะฟิลด์ resource_name
ไคลเอ็นต์ Google Ads API ต้องระบุฟิลด์ ad_group_criterion
หรือ campaign_criterion
ที่เกี่ยวข้องหากต้องดึงข้อมูลเกณฑ์ที่เฉพาะเจาะจง
ซึ่งจะช่วยให้ไคลเอ็นต์ Google Ads API สามารถขอฟิลด์ ad_group_criterion
หรือ campaign_criterion
และแหล่งข้อมูล *_view
ในคำขอเดียวกันไปยังเมธอด
GoogleAdsService.SearchStream
ได้
ตัวอย่างคำขอค้นหา
SELECT
ad_group_criterion.keyword.text,
ad_group.name,
campaign.name,
metrics.impressions,
metrics.clicks,
metrics.ctr,
metrics.average_cpc
FROM keyword_view
WHERE segments.date DURING LAST_30_DAYS
หากต้องการดึงข้อมูลประสิทธิภาพ (เมตริก) สำหรับเกณฑ์ประเภทใดประเภทหนึ่ง ให้ระบุทรัพยากรมุมมองที่เกี่ยวข้องในข้อความ FROM
เช่น ใช้
keyword_view
ในFROM
อนุประโยค และฟิลด์ metrics
บางรายการในSELECT
อนุประโยคเพื่อดึงข้อมูลเมตริกคีย์เวิร์ด
คุณเลือกฟิลด์จากทรัพยากรระดับบนสุดไปจนถึง customer
จาก
มุมมองเกณฑ์ได้ เช่น เมื่อเลือก FROM
keyword_view
คุณจะ
ขอฟิลด์จากแหล่งข้อมูลทั้งหมดต่อไปนี้ได้
ad_group_criterion
ad_group
campaign
customer
หากต้องการดูทรัพยากรที่ขอได้ด้วยวิธีนี้สำหรับทรัพยากรหนึ่งๆ ให้ดูแถวทรัพยากรแอตทริบิวต์ในหน้าอ้างอิงของทรัพยากรนั้น เช่น สำหรับ keyword_view
คุณจะดูแหล่งข้อมูลได้ในหน้าอ้างอิง
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-27 UTC
[null,null,["อัปเดตล่าสุด 2025-08-27 UTC"],[[["\u003cp\u003eEach criteria report in the Google Ads API is a separate resource, and clients need to specify \u003ccode\u003ead_group_criterion\u003c/code\u003e or \u003ccode\u003ecampaign_criterion\u003c/code\u003e fields to fetch specific criteria data.\u003c/p\u003e\n"],["\u003cp\u003eTo get performance data for a criteria type, use its corresponding view resource (e.g., \u003ccode\u003ekeyword_view\u003c/code\u003e) in the \u003ccode\u003eFROM\u003c/code\u003e clause of your query.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve data from parent resources, like \u003ccode\u003ead_group\u003c/code\u003e, \u003ccode\u003ecampaign\u003c/code\u003e, and \u003ccode\u003ecustomer\u003c/code\u003e, when querying a criteria view.\u003c/p\u003e\n"],["\u003cp\u003eThe "Attribute Resources" section on a resource's reference page shows which related resources can be included in your queries.\u003c/p\u003e\n"]]],[],null,["# Criteria Metrics\n\nIn the Google Ads API, each criteria report is represented by a separate resource.\nUnless otherwise necessary, `*_view` resources contain only a `resource_name`\nfield.\n\nGoogle Ads API clients must specify corresponding `ad_group_criterion` or\n`campaign_criterion` fields if any criteria specific data needs to be fetched.\nThis lets Google Ads API clients request `ad_group_criterion` or `campaign_criterion`\nfields and the `*_view` resource in the same request to the\n[`GoogleAdsService.SearchStream`](/google-ads/api/reference/rpc/v21/GoogleAdsService/SearchStream)\nmethod.\n\nSample query request\n--------------------\n\n SELECT\n ad_group_criterion.keyword.text,\n ad_group.name,\n campaign.name,\n metrics.impressions,\n metrics.clicks,\n metrics.ctr,\n metrics.average_cpc\n FROM keyword_view\n WHERE segments.date DURING LAST_30_DAYS\n\nTo retrieve performance data (metrics) for a specific criteria type, specify its\ncorresponding view resource in the `FROM` clause. For example, use\n`keyword_view` in the `FROM` clause and some `metrics` fields in the `SELECT`\nclause to retrieve keyword metrics.\n\nYou can select fields from parent resources all the way up to `customer` from a\ncriteria view. For example, when selecting `FROM` the `keyword_view`, you can\nrequest fields from all of the following resources:\n\n- `ad_group_criterion`\n- `ad_group`\n- `campaign`\n- `customer`\n\nTo discover the resources that can be requested in this way for a given\nresource, check the **Attribute Resources** row of its reference page. For\nexample, for `keyword_view`, you can find its resources on its [reference\npage](/google-ads/api/fields/v21/keyword_view)."]]