# Google Analytics Data V1beta API - Class Google::Analytics::Data::V1beta::MetricMetadata (v0.4.3)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [0.4.3 (latest)](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-MetricMetadata)
- [0.4.2](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/0.4.2/Google-Analytics-Data-V1beta-MetricMetadata)
Reference documentation and code samples for the Google Analytics Data V1beta API class Google::Analytics::Data::V1beta::MetricMetadata.

Explains a metric.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #api_name

    def api_name() -> ::String

**Returns**

- (::String) --- A metric name. Useable in [Metric](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-MetricMetadata#Metric)'s `name`. For example, `eventCount`.

### #api_name=

    def api_name=(value) -> ::String

**Parameter**

- **value** (::String) --- A metric name. Useable in [Metric](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-MetricMetadata#Metric)'s `name`. For example, `eventCount`.
**Returns**

- (::String) --- A metric name. Useable in [Metric](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-MetricMetadata#Metric)'s `name`. For example, `eventCount`.

### #blocked_reasons

    def blocked_reasons() -> ::Array<::Google::Analytics::Data::V1beta::MetricMetadata::BlockedReason>

**Returns**

- (::Array\<[::Google::Analytics::Data::V1beta::MetricMetadata::BlockedReason](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-MetricMetadata-BlockedReason)\>) --- If reasons are specified, your access is blocked to this metric for this property. API requests from you to this property for this metric will succeed; however, the report will contain only zeros for this metric. API requests with metric filters on blocked metrics will fail. If reasons are empty, you have access to this metric.


  To learn more, see [Access and data-restriction
  management](https://support.google.com/analytics/answer/10851388).

### #blocked_reasons=

    def blocked_reasons=(value) -> ::Array<::Google::Analytics::Data::V1beta::MetricMetadata::BlockedReason>

**Parameter**

- **value** (::Array\<[::Google::Analytics::Data::V1beta::MetricMetadata::BlockedReason](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-MetricMetadata-BlockedReason)\>) --- If reasons are specified, your access is blocked to this metric for this property. API requests from you to this property for this metric will succeed; however, the report will contain only zeros for this metric. API requests with metric filters on blocked metrics will fail. If reasons are empty, you have access to this metric.


  To learn more, see [Access and data-restriction
  management](https://support.google.com/analytics/answer/10851388).
**Returns**

- (::Array\<[::Google::Analytics::Data::V1beta::MetricMetadata::BlockedReason](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-MetricMetadata-BlockedReason)\>) --- If reasons are specified, your access is blocked to this metric for this property. API requests from you to this property for this metric will succeed; however, the report will contain only zeros for this metric. API requests with metric filters on blocked metrics will fail. If reasons are empty, you have access to this metric.


  To learn more, see [Access and data-restriction
  management](https://support.google.com/analytics/answer/10851388).

### #category

    def category() -> ::String

**Returns**

- (::String) --- The display name of the category that this metrics belongs to. Similar dimensions and metrics are categorized together.

### #category=

    def category=(value) -> ::String

**Parameter**

- **value** (::String) --- The display name of the category that this metrics belongs to. Similar dimensions and metrics are categorized together.
**Returns**

- (::String) --- The display name of the category that this metrics belongs to. Similar dimensions and metrics are categorized together.

### #custom_definition

    def custom_definition() -> ::Boolean

**Returns**

- (::Boolean) --- True if the metric is a custom metric for this property.

### #custom_definition=

    def custom_definition=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- True if the metric is a custom metric for this property.
**Returns**

- (::Boolean) --- True if the metric is a custom metric for this property.

### #deprecated_api_names

    def deprecated_api_names() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Still usable but deprecated names for this metric. If populated, this metric is available by either `apiName` or one of `deprecatedApiNames` for a period of time. After the deprecation period, the metric will be available only by `apiName`.

### #deprecated_api_names=

    def deprecated_api_names=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- Still usable but deprecated names for this metric. If populated, this metric is available by either `apiName` or one of `deprecatedApiNames` for a period of time. After the deprecation period, the metric will be available only by `apiName`.
**Returns**

- (::Array\<::String\>) --- Still usable but deprecated names for this metric. If populated, this metric is available by either `apiName` or one of `deprecatedApiNames` for a period of time. After the deprecation period, the metric will be available only by `apiName`.

### #description

    def description() -> ::String

**Returns**

- (::String) --- Description of how this metric is used and calculated.

### #description=

    def description=(value) -> ::String

**Parameter**

- **value** (::String) --- Description of how this metric is used and calculated.
**Returns**

- (::String) --- Description of how this metric is used and calculated.

### #expression

    def expression() -> ::String

**Returns**

- (::String) --- The mathematical expression for this derived metric. Can be used in [Metric](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-MetricMetadata#Metric)'s `expression` field for equivalent reports. Most metrics are not expressions, and for non-expressions, this field is empty.

### #expression=

    def expression=(value) -> ::String

**Parameter**

- **value** (::String) --- The mathematical expression for this derived metric. Can be used in [Metric](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-MetricMetadata#Metric)'s `expression` field for equivalent reports. Most metrics are not expressions, and for non-expressions, this field is empty.
**Returns**

- (::String) --- The mathematical expression for this derived metric. Can be used in [Metric](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-MetricMetadata#Metric)'s `expression` field for equivalent reports. Most metrics are not expressions, and for non-expressions, this field is empty.

### #type

    def type() -> ::Google::Analytics::Data::V1beta::MetricType

**Returns**

- ([::Google::Analytics::Data::V1beta::MetricType](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-MetricType)) --- The type of this metric.

### #type=

    def type=(value) -> ::Google::Analytics::Data::V1beta::MetricType

**Parameter**

- **value** ([::Google::Analytics::Data::V1beta::MetricType](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-MetricType)) --- The type of this metric.
**Returns**

- ([::Google::Analytics::Data::V1beta::MetricType](https://docs.cloud.google.com/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-MetricType)) --- The type of this metric.

### #ui_name

    def ui_name() -> ::String

**Returns**

- (::String) --- This metric's name within the Google Analytics user interface. For example, `Event count`.

### #ui_name=

    def ui_name=(value) -> ::String

**Parameter**

- **value** (::String) --- This metric's name within the Google Analytics user interface. For example, `Event count`.
**Returns**

- (::String) --- This metric's name within the Google Analytics user interface. For example, `Event count`.