Reference documentation and code samples for the Google Analytics Admin V1alpha API class Google::Analytics::Admin::V1alpha::CustomMetric.
A definition for a custom metric.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#description
defdescription()->::String
Returns
(::String) — Optional. Description for this custom dimension.
Max length of 150 characters.
#description=
defdescription=(value)->::String
Parameter
value (::String) — Optional. Description for this custom dimension.
Max length of 150 characters.
Returns
(::String) — Optional. Description for this custom dimension.
Max length of 150 characters.
#display_name
defdisplay_name()->::String
Returns
(::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.
#display_name=
defdisplay_name=(value)->::String
Parameter
value (::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.
Returns
(::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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Google Analytics Admin V1alpha API - Class Google::Analytics::Admin::V1alpha::CustomMetric (v0.11.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.11.0 (latest)](/ruby/docs/reference/google-analytics-admin-v1alpha/latest/Google-Analytics-Admin-V1alpha-CustomMetric)\n- [0.10.0](/ruby/docs/reference/google-analytics-admin-v1alpha/0.10.0/Google-Analytics-Admin-V1alpha-CustomMetric)\n- [0.9.1](/ruby/docs/reference/google-analytics-admin-v1alpha/0.9.1/Google-Analytics-Admin-V1alpha-CustomMetric) \nReference documentation and code samples for the Google Analytics Admin V1alpha API class Google::Analytics::Admin::V1alpha::CustomMetric.\n\nA definition for a custom metric. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #description\n\n def description() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Optional. Description for this custom dimension. Max length of 150 characters.\n\n### #description=\n\n def description=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Optional. Description for this custom dimension. Max length of 150 characters. \n**Returns**\n\n- (::String) --- Optional. Description for this custom dimension. Max length of 150 characters.\n\n### #display_name\n\n def display_name() -\u003e ::String\n\n**Returns**\n\n- (::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\n### #display_name=\n\n def display_name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::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**Returns**\n\n- (::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\n### #measurement_unit\n\n def measurement_unit() -\u003e ::Google::Analytics::Admin::V1alpha::CustomMetric::MeasurementUnit\n\n**Returns**\n\n- ([::Google::Analytics::Admin::V1alpha::CustomMetric::MeasurementUnit](./Google-Analytics-Admin-V1alpha-CustomMetric-MeasurementUnit)) --- Required. The type for the custom metric's value.\n\n### #measurement_unit=\n\n def measurement_unit=(value) -\u003e ::Google::Analytics::Admin::V1alpha::CustomMetric::MeasurementUnit\n\n**Parameter**\n\n- **value** ([::Google::Analytics::Admin::V1alpha::CustomMetric::MeasurementUnit](./Google-Analytics-Admin-V1alpha-CustomMetric-MeasurementUnit)) --- Required. The type for the custom metric's value. \n**Returns**\n\n- ([::Google::Analytics::Admin::V1alpha::CustomMetric::MeasurementUnit](./Google-Analytics-Admin-V1alpha-CustomMetric-MeasurementUnit)) --- Required. The type for the custom metric's value.\n\n### #name\n\n def name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Output only. Resource name for this CustomMetric resource. Format: properties/{property}/customMetrics/{customMetric}\n\n### #parameter_name\n\n def parameter_name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Required. Immutable. Tagging name for this custom metric.\n\n If this is an event-scoped metric, then this is the event parameter\n name.\n\n May only contain alphanumeric and underscore charactes, starting with a\n letter. Max length of 40 characters for event-scoped metrics.\n\n### #parameter_name=\n\n def parameter_name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Required. Immutable. Tagging name for this custom metric.\n\n\n If this is an event-scoped metric, then this is the event parameter\n name.\n\n May only contain alphanumeric and underscore charactes, starting with a\nletter. Max length of 40 characters for event-scoped metrics. \n**Returns**\n\n- (::String) --- Required. Immutable. Tagging name for this custom metric.\n\n If this is an event-scoped metric, then this is the event parameter\n name.\n\n May only contain alphanumeric and underscore charactes, starting with a\n letter. Max length of 40 characters for event-scoped metrics.\n\n### #restricted_metric_type\n\n def restricted_metric_type() -\u003e ::Array\u003c::Google::Analytics::Admin::V1alpha::CustomMetric::RestrictedMetricType\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Analytics::Admin::V1alpha::CustomMetric::RestrictedMetricType](./Google-Analytics-Admin-V1alpha-CustomMetric-RestrictedMetricType)\\\u003e) --- 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\n### #restricted_metric_type=\n\n def restricted_metric_type=(value) -\u003e ::Array\u003c::Google::Analytics::Admin::V1alpha::CustomMetric::RestrictedMetricType\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Analytics::Admin::V1alpha::CustomMetric::RestrictedMetricType](./Google-Analytics-Admin-V1alpha-CustomMetric-RestrictedMetricType)\\\u003e) --- 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**Returns**\n\n- (::Array\\\u003c[::Google::Analytics::Admin::V1alpha::CustomMetric::RestrictedMetricType](./Google-Analytics-Admin-V1alpha-CustomMetric-RestrictedMetricType)\\\u003e) --- 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\n### #scope\n\n def scope() -\u003e ::Google::Analytics::Admin::V1alpha::CustomMetric::MetricScope\n\n**Returns**\n\n- ([::Google::Analytics::Admin::V1alpha::CustomMetric::MetricScope](./Google-Analytics-Admin-V1alpha-CustomMetric-MetricScope)) --- Required. Immutable. The scope of this custom metric.\n\n### #scope=\n\n def scope=(value) -\u003e ::Google::Analytics::Admin::V1alpha::CustomMetric::MetricScope\n\n**Parameter**\n\n- **value** ([::Google::Analytics::Admin::V1alpha::CustomMetric::MetricScope](./Google-Analytics-Admin-V1alpha-CustomMetric-MetricScope)) --- Required. Immutable. The scope of this custom metric. \n**Returns**\n\n- ([::Google::Analytics::Admin::V1alpha::CustomMetric::MetricScope](./Google-Analytics-Admin-V1alpha-CustomMetric-MetricScope)) --- Required. Immutable. The scope of this custom metric."]]