Method: properties.fetchConnectedGa4Property
根據指定的通用 Analytics 資源,查詢與該資源連結的 GA4 資源。注意:這項功能無法與 GA4 資源搭配使用。
HTTP 要求
GET https://analyticsadmin.googleapis.com/v1alpha/properties:fetchConnectedGa4Property
這個網址使用 gRPC 轉碼語法。
查詢參數
參數 |
property |
string
必要欄位。要查詢已連結 GA4 資源的通用 Analytics 資源。請注意,這項要求使用的是內部資源 ID,而非 UA-XXXXXX-YY 格式的追蹤 ID。格式:properties/{internal_web_property_id} 範例:properties/1234
|
回應主體
查詢連結至通用 Analytics 資源的 GA4 資源。
如果成功,回應主體會含有以下結構的資料:
JSON 表示法 |
{
"property": string
} |
欄位 |
property |
string
已連結至通用 Analytics 資源的 GA4 資源。沒有已連結的 GA4 資源時,系統會傳回空白字串。格式:properties/{property_id} 範例:properties/1234
|
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/analytics.readonly
https://www.googleapis.com/auth/analytics.edit
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-08-29 (世界標準時間)。
[null,null,["上次更新時間:2024-08-29 (世界標準時間)。"],[[["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"]]