سرور MCP را برای Google Analytics امتحان کنید. از
GitHub نصب کنید و برای جزئیات بیشتر به
اطلاعیه مراجعه کنید.
REST Resource: properties.customMetrics
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
منبع: CustomMetric
تعریفی برای یک متریک سفارشی.
نمایندگی JSON |
---|
{
"name": string,
"parameterName": string,
"displayName": string,
"description": string,
"measurementUnit": enum (MeasurementUnit ),
"scope": enum (MetricScope ),
"restrictedMetricType": [
enum (RestrictedMetricType )
]
} |
فیلدها |
---|
name | string فقط خروجی نام منبع برای این منبع CustomMetric. قالب: خواص/{property}/customMetrics/{customMetric} |
parameterName | string مورد نیاز. تغییرناپذیر. نام برچسب گذاری برای این معیار سفارشی. اگر این یک متریک با دامنه رویداد است، این نام پارامتر رویداد است. ممکن است فقط شامل نویسههای حروف عددی و زیرخط باشد که با یک حرف شروع میشوند. حداکثر طول 40 نویسه برای معیارهای محدوده رویداد. |
displayName | string مورد نیاز. نام نمایشی برای این معیار سفارشی همانطور که در رابط کاربری Analytics نشان داده شده است. حداکثر طول 82 کاراکتر، حروف عددی به اضافه فاصله و خط زیر که با یک حرف شروع می شود. نامهای نمایشی تولید شده توسط سیستم قدیمی ممکن است دارای کروشه باشد، اما بهروزرسانیهای این فیلد هرگز اجازه ایجاد براکت را نمیدهد. |
description | string اختیاری. توضیحات برای این بعد سفارشی. حداکثر طول 150 کاراکتر |
measurementUnit | enum ( MeasurementUnit ) مورد نیاز. نوع مقدار متریک سفارشی. |
scope | enum ( MetricScope ) مورد نیاز. تغییرناپذیر. دامنه این معیار سفارشی. |
restrictedMetricType[] | enum ( RestrictedMetricType ) اختیاری. انواع دادههای محدود شده که این معیار ممکن است شامل شود. برای معیارهای با واحد اندازه گیری CURRENCY مورد نیاز است. برای معیارهایی با واحد اندازه گیری غیر CURRENCY باید خالی باشد. |
واحد اندازه گیری
انواع احتمالی نمایش مقدار معیار سفارشی.
نمایش ارز ممکن است در آینده تغییر کند، که نیاز به تغییر API قطعی دارد.
Enums |
---|
MEASUREMENT_UNIT_UNSPECIFIED | واحد اندازه گیری مشخص نشده یا وجود ندارد. |
STANDARD | این معیار از واحدهای پیش فرض استفاده می کند. |
CURRENCY | این معیار یک واحد پولی را اندازه گیری می کند. |
FEET | این متریک پاها را اندازه گیری می کند. |
METERS | این متریک متر را اندازه گیری می کند. |
KILOMETERS | این متریک کیلومتر را اندازه گیری می کند. |
MILES | این متریک مایل ها را اندازه گیری می کند. |
MILLISECONDS | این متریک میلی ثانیه را اندازه گیری می کند. |
SECONDS | این متریک ثانیه ها را اندازه گیری می کند. |
MINUTES | این متریک دقیقه ها را اندازه گیری می کند. |
HOURS | این متریک ساعت ها را اندازه گیری می کند. |
MetricScope
Enums |
---|
METRIC_SCOPE_UNSPECIFIED | محدوده نامعلوم یا مشخص نشده است. |
EVENT | مقیاس اندازه گیری به یک رویداد. |
RestrictedMetricType
برچسبهایی که دادهها را در این معیار سفارشی بهعنوان دادههایی که باید به کاربران خاصی محدود شود، علامتگذاری میکنند.
Enums |
---|
RESTRICTED_METRIC_TYPE_UNSPECIFIED | تایپ ناشناخته یا نامشخص |
COST_DATA | داده های هزینه گزارش های متریک |
REVENUE_DATA | Metric داده های درآمد را گزارش می دهد. |
روش ها |
---|
| CustomMetric را در یک ملک بایگانی می کند. |
| CustomMetric ایجاد می کند. |
| جستجو برای یک CustomMetric واحد. |
| CustomMetrics را در یک ویژگی فهرست می کند. |
| CustomMetric را در یک ویژگی به روز می کند. |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\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,["- [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 A 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 Possible 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 The 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 Labels 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. |"]]