ลองใช้เซิร์ฟเวอร์ MCP สำหรับ Google Analytics ติดตั้งจาก
GitHub และดูรายละเอียดเพิ่มเติมได้ที่
ประกาศ
Method: properties.calculatedMetrics.create
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คำขอ HTTP
POST https://analyticsadmin.googleapis.com/v1alpha/{parent=properties/*}/calculatedMetrics
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
parent |
string
ต้องระบุ รูปแบบ: พร็อพเพอร์ตี้/{property_id} ตัวอย่าง: พร็อพเพอร์ตี้/1234
|
พารามิเตอร์การค้นหา
พารามิเตอร์ |
calculatedMetricId |
string
ต้องระบุ รหัสที่ใช้สำหรับเมตริกที่คำนวณแล้วซึ่งจะกลายเป็นองค์ประกอบสุดท้ายของชื่อทรัพยากรของเมตริกที่คำนวณแล้ว ค่านี้ควรมีอักขระ 1-80 ตัว และอักขระที่ถูกต้องคือ /[a-zA-Z0-9_]/ โดยไม่เว้นวรรค เมตริกที่คำนวณแล้วทั้งหมดภายในพร็อพเพอร์ตี้ต้องไม่ซ้ำกัน ระบบจะใช้ที่คำนวณเมตริกId เมื่ออ้างอิงเมตริกที่คำนวณแล้วนี้จาก API ภายนอก เช่น "calcMetric:{calculatordMetricId}"
|
เนื้อหาของคำขอ
เนื้อความของคำขอมีอินสแตนซ์ของ CalculatedMetric
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ CalculatedMetric
ที่สร้างขึ้นใหม่
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth ต่อไปนี้
https://www.googleapis.com/auth/analytics.edit
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["Creates a new CalculatedMetric within a specified Google Analytics 4 property using an HTTP POST request."],["Requires providing a unique `calculatedMetricId` and the `property_id` as path and query parameters, respectively."],["The request body should contain the CalculatedMetric definition, and a successful response will return the newly created CalculatedMetric instance."],["Users need to have the `analytics.edit` OAuth scope to authorize this operation."]]],["This documentation details how to create a CalculatedMetric via a `POST` request to the specified URL, including required components such as path and query parameters, the request body and the response body. The path parameter `parent` defines the property ID. The query parameter `calculatedMetricId` is a unique identifier. The request and response bodies are `CalculatedMetric` instances. This action requires authorization scope: `https://www.googleapis.com/auth/analytics.edit`.\n"]]