Method: properties.fetchConnectedGa4Property
Nếu bạn đã chỉ định một tài sản UA, hãy tra cứu tài sản GA4 được kết nối với tài sản đó. Lưu ý: Bạn không thể sử dụng tính năng này cho tài sản GA4.
Yêu cầu HTTP
GET https://analyticsadmin.googleapis.com/v1alpha/properties:fetchConnectedGa4Property
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số truy vấn
Tham số |
property |
string
Bắt buộc. Tài sản UA cần tra cứu tài sản GA4 được kết nối. Xin lưu ý rằng yêu cầu này sử dụng mã tài sản nội bộ, chứ không phải mã theo dõi có dạng UA-XXXXXX-YY. Định dạng: thuộc tính/{internal_web_property_id} Ví dụ: thuộc tính/1234
|
Nội dung yêu cầu
Nội dung yêu cầu phải trống.
Nội dung phản hồi
Phản hồi về việc tìm tài sản GA4 được kết nối với một tài sản UA.
Nếu thành công, phần nội dung phản hồi sẽ chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON |
{
"property": string
} |
Trường |
property |
string
Tài sản GA4 được kết nối với tài sản UA. Hệ thống sẽ trả về một chuỗi trống khi không có tài sản GA4 nào được kết nối. Định dạng: thuộc tính/{property_id} Ví dụ: thuộc tính/1234
|
Phạm vi uỷ quyền
Yêu cầu một trong các phạm vi OAuth sau:
https://www.googleapis.com/auth/analytics.readonly
https://www.googleapis.com/auth/analytics.edit
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2024-08-29 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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"]]