Chỉ có đầu ra. Tên tài nguyên của tài nguyên CustomMetric này. Định dạng: thuộc tính/{property}/customMetrics/{customMetric}
parameterName
string
Bắt buộc. Bất biến. Tên gắn thẻ cho chỉ số tuỳ chỉnh này.
Nếu đây là chỉ số ở phạm vi sự kiện, thì đây là tên thông số sự kiện.
Chỉ được chứa các ký tự chữ-số và dấu gạch dưới, bắt đầu bằng một chữ cái. Độ dài tối đa là 40 ký tự cho các chỉ số ở phạm vi sự kiện.
displayName
string
Bắt buộc. Tên hiển thị cho chỉ số tuỳ chỉnh này như được hiển thị trong giao diện người dùng Analytics. Độ dài tối đa là 82 ký tự, gồm cả chữ và số, cộng với dấu cách và dấu gạch dưới bắt đầu bằng một chữ cái. Tên hiển thị cũ do hệ thống tạo có thể chứa dấu ngoặc vuông, nhưng nội dung cập nhật cho trường này sẽ không bao giờ cho phép sử dụng dấu ngoặc vuông.
description
string
Không bắt buộc. Nội dung mô tả cho phương diện tuỳ chỉnh này. Độ dài tối đa 150 ký tự.
Không bắt buộc. Các loại dữ liệu bị hạn chế có trong chỉ số này. Bắt buộc đối với những chỉ số có đơn vị đo lường CURRENCY. Phải để trống đối với những chỉ số có đơn vị đo lường không phải CURRENCY.
MeasurementUnit
Các loại có thể biểu thị giá trị của chỉ số tùy chỉnh.
Nội dung trình bày về đơn vị tiền tệ có thể thay đổi trong tương lai, đòi hỏi phải có sự thay đổi về API có thể gây lỗi.
Enum
MEASUREMENT_UNIT_UNSPECIFIED
Đơn vị đo lường không được chỉ định hoặc bị thiếu.
STANDARD
Chỉ số này sử dụng các đơn vị mặc định.
CURRENCY
Chỉ số này đo lường một đơn vị tiền tệ.
FEET
Chỉ số này đo lường bộ.
METERS
Chỉ số này đo lường số mét.
KILOMETERS
Chỉ số này đo lường số kilômét.
MILES
Chỉ số này đo lường dặm.
MILLISECONDS
Chỉ số này đo lường bằng mili giây.
SECONDS
Chỉ số này đo lường số giây.
MINUTES
Chỉ số này đo lường số phút.
HOURS
Chỉ số này đo lường giờ.
MetricScope
Phạm vi của chỉ số này.
Enum
METRIC_SCOPE_UNSPECIFIED
Phạm vi không xác định hoặc chưa được chỉ định.
EVENT
Chỉ số trong phạm vi một sự kiện.
RestrictedMetricType
Các nhãn đánh dấu dữ liệu trong chỉ số tuỳ chỉnh này là dữ liệu nên được giới hạn ở một số người dùng cụ thể.
[[["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\u003eA \u003ccode\u003eCustomMetric\u003c/code\u003e defines custom metrics for data analysis within Google Analytics, allowing users to track specific events and parameters relevant to their business needs.\u003c/p\u003e\n"],["\u003cp\u003eThese metrics can be defined with various units of measurement (\u003ccode\u003eMeasurementUnit\u003c/code\u003e) including standard, currency, time, and distance, catering to diverse data types.\u003c/p\u003e\n"],["\u003cp\u003eThe scope of a custom metric can be specified (\u003ccode\u003eMetricScope\u003c/code\u003e) to be associated with an event, dictating the context in which the metric is collected.\u003c/p\u003e\n"],["\u003cp\u003eCustom metrics can also be designated as containing restricted data types such as cost or revenue (\u003ccode\u003eRestrictedMetricType\u003c/code\u003e) for enhanced privacy and access control.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Analytics provides methods to manage custom metrics: \u003ccode\u003earchive\u003c/code\u003e, \u003ccode\u003ecreate\u003c/code\u003e, \u003ccode\u003eget\u003c/code\u003e, \u003ccode\u003elist\u003c/code\u003e, and \u003ccode\u003epatch\u003c/code\u003e, allowing for comprehensive control over these custom data points.\u003c/p\u003e\n"]]],["CustomMetrics are defined by a name, parameter name, display name, description, measurement unit, scope, and restricted metric type. Measurement units include standard, currency, distance, and time. Metric scopes can be event-based. Restricted metric types include cost and revenue data. Key actions involve creating, retrieving, listing, updating, and archiving custom metrics, utilizing methods for each of these operations, like create, get, list, patch, and archive.\n"],null,["# REST Resource: properties.customMetrics\n\n- [Resource: CustomMetric](#CustomMetric)\n - [JSON representation](#CustomMetric.SCHEMA_REPRESENTATION)\n- [MeasurementUnit](#MeasurementUnit)\n- [MetricScope](#MetricScope)\n- [RestrictedMetricType](#RestrictedMetricType)\n- [Methods](#METHODS_SUMMARY)\n\nResource: CustomMetric\n----------------------\n\nA definition for a custom metric.\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"name\": string, \"parameterName\": string, \"displayName\": string, \"description\": string, \"measurementUnit\": enum (/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customMetrics#MeasurementUnit), \"scope\": enum (/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customMetrics#MetricScope), \"restrictedMetricType\": [ enum (/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customMetrics#RestrictedMetricType) ] } ``` |\n\n| Fields ||\n|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Output only. Resource name for this CustomMetric resource. Format: properties/{property}/customMetrics/{customMetric} |\n| `parameterName` | `string` Required. Immutable. Tagging name for this custom metric. If this is an event-scoped metric, then this is the event parameter name. May only contain alphanumeric and underscore charactes, starting with a letter. Max length of 40 characters for event-scoped metrics. |\n| `displayName` | `string` Required. Display name for this custom metric as shown in the Analytics UI. Max length of 82 characters, alphanumeric plus space and underscore starting with a letter. Legacy system-generated display names may contain square brackets, but updates to this field will never permit square brackets. |\n| `description` | `string` Optional. Description for this custom dimension. Max length of 150 characters. |\n| `measurementUnit` | `enum (`[MeasurementUnit](/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customMetrics#MeasurementUnit)`)` Required. The type for the custom metric's value. |\n| `scope` | `enum (`[MetricScope](/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customMetrics#MetricScope)`)` Required. Immutable. The scope of this custom metric. |\n| `restrictedMetricType[]` | `enum (`[RestrictedMetricType](/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customMetrics#RestrictedMetricType)`)` Optional. Types of restricted data that this metric may contain. Required for metrics with CURRENCY measurement unit. Must be empty for metrics with a non-CURRENCY measurement unit. |\n\nMeasurementUnit\n---------------\n\nPossible types of representing the custom metric's value.\n\nCurrency representation may change in the future, requiring a breaking API change.\n\n| Enums ||\n|--------------------------------|-----------------------------------------|\n| `MEASUREMENT_UNIT_UNSPECIFIED` | MeasurementUnit unspecified or missing. |\n| `STANDARD` | This metric uses default units. |\n| `CURRENCY` | This metric measures a currency. |\n| `FEET` | This metric measures feet. |\n| `METERS` | This metric measures meters. |\n| `KILOMETERS` | This metric measures kilometers. |\n| `MILES` | This metric measures miles. |\n| `MILLISECONDS` | This metric measures milliseconds. |\n| `SECONDS` | This metric measures seconds. |\n| `MINUTES` | This metric measures minutes. |\n| `HOURS` | This metric measures hours. |\n\nMetricScope\n-----------\n\nThe scope of this metric.\n\n| Enums ||\n|----------------------------|---------------------------------|\n| `METRIC_SCOPE_UNSPECIFIED` | Scope unknown or not specified. |\n| `EVENT` | Metric scoped to an event. |\n\nRestrictedMetricType\n--------------------\n\nLabels that mark the data in this custom metric as data that should be restricted to specific users.\n\n| Enums ||\n|--------------------------------------|------------------------------|\n| `RESTRICTED_METRIC_TYPE_UNSPECIFIED` | Type unknown or unspecified. |\n| `COST_DATA` | Metric reports cost data. |\n| `REVENUE_DATA` | Metric reports revenue data. |\n\n| Methods ------- ||\n|---------------------------------------------------------------------------------------------------|----------------------------------------|\n| ### [archive](/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customMetrics/archive) | Archives a CustomMetric on a property. |\n| ### [create](/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customMetrics/create) | Creates a CustomMetric. |\n| ### [get](/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customMetrics/get) | Lookup for a single CustomMetric. |\n| ### [list](/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customMetrics/list) | Lists CustomMetrics on a property. |\n| ### [patch](/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customMetrics/patch) | Updates a CustomMetric on a property. |"]]