Method: properties.fetchConnectedGa4Property
เมื่อมีพร็อพเพอร์ตี้ UA ที่เฉพาะเจาะจง ให้ค้นหาพร็อพเพอร์ตี้ GA4 ที่เชื่อมต่ออยู่ หมายเหตุ: ใช้ไม่ได้กับพร็อพเพอร์ตี้ GA4
คำขอ HTTP
GET https://analyticsadmin.googleapis.com/v1alpha/properties:fetchConnectedGa4Property
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์การค้นหา
พารามิเตอร์ |
property |
string
ต้องระบุ พร็อพเพอร์ตี้ UA ที่จะค้นหาพร็อพเพอร์ตี้ GA4 ที่เชื่อมต่อ โปรดทราบว่าคำขอนี้ใช้รหัสพร็อพเพอร์ตี้ภายใน ไม่ใช่รหัสติดตามในรูปแบบ UA-XXXXXX-YY รูปแบบ: พร็อพเพอร์ตี้/{internal_web_property_id} ตัวอย่าง: พร็อพเพอร์ตี้/1234
|
เนื้อหาของคำขอ
เนื้อหาของคำขอต้องว่างเปล่า
เนื้อหาการตอบกลับ
คําตอบสําหรับการค้นหาพร็อพเพอร์ตี้ GA4 ที่เชื่อมต่อกับพร็อพเพอร์ตี้ UA
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีข้อมูลซึ่งมีโครงสร้างดังต่อไปนี้
การแสดง JSON |
{
"property": string
} |
ช่อง |
property |
string
พร็อพเพอร์ตี้ GA4 ที่เชื่อมต่อกับพร็อพเพอร์ตี้ UA ระบบจะแสดงผลสตริงว่างเมื่อไม่มีพร็อพเพอร์ตี้ GA4 ที่เชื่อมต่ออยู่ รูปแบบ: พร็อพเพอร์ตี้/{property_id} เช่น พร็อพเพอร์ตี้/1234
|
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth รายการใดรายการหนึ่งต่อไปนี้
https://www.googleapis.com/auth/analytics.readonly
https://www.googleapis.com/auth/analytics.edit
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-08-29 UTC
[null,null,["อัปเดตล่าสุด 2024-08-29 UTC"],[[["This document details how to look up the connected Google Analytics 4 (GA4) property for a given Universal Analytics (UA) property using the Google Analytics Admin API."],["The API request requires the internal UA property ID and returns the connected GA4 property ID, if any."],["Authentication requires specific OAuth scopes for either read-only or edit access to Analytics data."],["It is important to note that this functionality cannot be used with GA4 properties and requires an empty request body."]]],["This document details how to find a connected GA4 property using its associated UA property. A `GET` request to `https://analyticsadmin.googleapis.com/v1alpha/properties:fetchConnectedGa4Property` is made. The request requires a `property` query parameter, which is the UA property's internal ID, formatted as `properties/{internal_web_property_id}`. The request body must be empty. The response body returns a JSON structure containing a `property` field with the GA4 property ID or an empty string if none exists. The request needs authorization with specific OAuth scopes.\n"]]