Trả về siêu dữ liệu cho các phương diện và chỉ số có trong phương pháp báo cáo. Dùng để khám phá các phương diện và chỉ số. Trong phương thức này, giá trị nhận dạng tài sản Google Analytics được chỉ định trong yêu cầu và phản hồi siêu dữ liệu bao gồm các Phương diện và chỉ số tuỳ chỉnh cũng như siêu dữ liệu Universal.
Ví dụ: nếu một chỉ số tuỳ chỉnh có tên thông số là levels_unlocked được đăng ký cho một tài sản, thì phản hồi Siêu dữ liệu sẽ chứa customEvent:levels_unlocked. Siêu dữ liệu chung là các phương diện và chỉ số áp dụng cho mọi tài sản, chẳng hạn như country và totalUsers.
Yêu cầu HTTP
GET https://analyticsdata.googleapis.com/v1beta/{name=properties/*/metadata}
Bắt buộc. Tên tài nguyên của siêu dữ liệu cần truy xuất. Trường tên này được chỉ định trong đường dẫn URL chứ không phải tham số URL. Tài sản là giá trị nhận dạng tài sản Google Analytics dạng số. Để tìm hiểu thêm, hãy xem bài viết nơi tìm mã tài sản.
Ví dụ: properties/1234/metadata
Đặt Mã tài sản thành 0 cho các phương diện và chỉ số chung cho tất cả tài sản. Ở chế độ đặc biệt này, phương thức này sẽ không trả về phương diện và chỉ số tuỳ chỉnh.
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
Các phương diện, chỉ số và thông tin so sánh hiện được chấp nhận trong các phương pháp báo cáo.
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:
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eReturns metadata for dimensions, metrics, and comparisons available in reporting methods for a specified Google Analytics GA4 Property.\u003c/p\u003e\n"],["\u003cp\u003eIncludes both custom and Universal metadata, allowing exploration of available data points.\u003c/p\u003e\n"],["\u003cp\u003eAccepts a Google Analytics GA4 Property Identifier in the request to retrieve property-specific metadata.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with specific OAuth scopes for accessing the data.\u003c/p\u003e\n"],["\u003cp\u003eProvides details about dimensions, metrics, and comparisons through comprehensive metadata descriptions.\u003c/p\u003e\n"]]],["This method retrieves metadata for dimensions, metrics, and comparisons used in Google Analytics reporting. It utilizes a `GET` HTTP request with a required property ID in the URL path (`name`) to specify the target property. An empty request body is required. The response contains a JSON structure with descriptions of available dimensions, metrics, and comparisons, including universal and custom ones. Setting the property ID to '0' will only return universal data. Two authorization scopes are required to utilize this method.\n"],null,["# Method: properties.getMetadata\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.Metadata.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [ComparisonMetadata](#ComparisonMetadata)\n - [JSON representation](#ComparisonMetadata.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nReturns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics property identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata.\n\nFor example if a custom metric with parameter name `levels_unlocked` is registered to a property, the Metadata response will contain `customEvent:levels_unlocked`. Universal metadata are dimensions and metrics applicable to any property such as `country` and `totalUsers`.\n\n### HTTP request\n\n`GET https://analyticsdata.googleapis.com/v1beta/{name=properties/*/metadata}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. The resource name of the metadata to retrieve. This name field is specified in the URL path and not URL parameters. Property is a numeric Google Analytics property identifier. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id). Example: properties/1234/metadata Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nThe dimensions, metrics and comparisons currently accepted in reporting methods.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"name\": string, \"dimensions\": [ { object (/analytics/devguides/reporting/data/v1/rest/v1beta/DimensionMetadata) } ], \"metrics\": [ { object (/analytics/devguides/reporting/data/v1/rest/v1beta/MetricMetadata) } ], \"comparisons\": [ { object (/analytics/devguides/reporting/data/v1/rest/v1beta/properties/getMetadata#ComparisonMetadata) } ] } ``` |\n\n| Fields ||\n|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Resource name of this metadata. |\n| `dimensions[]` | `object (`[DimensionMetadata](/analytics/devguides/reporting/data/v1/rest/v1beta/DimensionMetadata)`)` The dimension descriptions. |\n| `metrics[]` | `object (`[MetricMetadata](/analytics/devguides/reporting/data/v1/rest/v1beta/MetricMetadata)`)` The metric descriptions. |\n| `comparisons[]` | `object (`[ComparisonMetadata](/analytics/devguides/reporting/data/v1/rest/v1beta/properties/getMetadata#ComparisonMetadata)`)` The comparison descriptions. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/analytics.readonly`\n- `https://www.googleapis.com/auth/analytics`\n\nComparisonMetadata\n------------------\n\nThe metadata for a single comparison.\n\n| JSON representation |\n|------------------------------------------------------------------------|\n| ``` { \"apiName\": string, \"uiName\": string, \"description\": string } ``` |\n\n| Fields ||\n|---------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| `api``Name` | `string` This comparison's resource name. Useable in [Comparison](#Comparison)'s `comparison` field. For example, 'comparisons/1234'. |\n| `ui``Name` | `string` This comparison's name within the Google Analytics user interface. |\n| `description` | `string` This comparison's description. |"]]