Method: properties.fetchConnectedGa4Property
با توجه به ویژگی UA مشخص شده، ویژگی GA4 متصل به آن را جستجو می کند. توجه: این را نمی توان با ویژگی های GA4 استفاده کرد.
درخواست HTTP
GET https://analyticsadmin.googleapis.com/v1alpha/properties:fetchConnectedGa4Property
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای پرس و جو
پارامترها |
---|
property | string مورد نیاز. ویژگی UA که برای جستجوی ویژگی GA4 متصل شده است. توجه داشته باشید که این درخواست از شناسه دارایی داخلی استفاده می کند، نه شناسه ردیابی فرم UA-XXXXXX-YY. قالب: خواص/{internal_web_property_id} مثال: properties/1234 |
درخواست بدن
بدنه درخواست باید خالی باشد.
بدن پاسخگو
پاسخ برای جستجوی ویژگی GA4 متصل به یک دارایی UA.
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی داده هایی با ساختار زیر است:
نمایندگی JSON |
---|
{
"property": string
} |
فیلدها |
---|
property | string ویژگی GA4 به ویژگی UA متصل است. زمانی که هیچ خاصیت GA4 متصلی وجود نداشته باشد، یک رشته خالی برگردانده می شود. قالب: خواص/{property_id} مثال: properties/1234 |
محدوده مجوز
به یکی از حوزه های OAuth زیر نیاز دارد:
-
https://www.googleapis.com/auth/analytics.readonly
-
https://www.googleapis.com/auth/analytics.edit
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-01-06 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-01-06 بهوقت ساعت هماهنگ جهانی."],[[["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"]]