properties

POST /v1beta/properties/{propertiesId}/customMetrics

Creates a CustomMetric.

Request

  • Base URL
    https://analyticsadmin.googleapis.com
  • Auth
    OAuth 2 and OAuth 2
    Implicithttps://accounts.google.com/o/oauth2/auth
    Scopeshttps://www.googleapis.com/auth/analytics.edit
    Authorization codehttps://accounts.google.com/o/oauth2/auth
    Token URLhttps://accounts.google.com/o/oauth2/token
    Scopeshttps://www.googleapis.com/auth/analytics.edit

Path parameters

propertiesId, string required

Query parameters

$.xgafv, '1' | '2'

V1 error format.

access_token, string

OAuth access token.

alt, 'json' | 'media' | 'proto'

Data format for response.

callback, string

JSONP

fields, string

Selector specifying which fields to include in a partial response.

key, string

API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

oauth_token, string

OAuth 2.0 token for the current user.

prettyPrint, boolean

Returns response with indentations and line breaks.

quotaUser, string

Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

uploadType, string

Legacy upload protocol for media (e.g. "media", "multipart").

upload_protocol, string

Upload protocol for media (e.g. "raw", "multipart").

Request body

GoogleAnalyticsAdminV1betaCustomMetric required

A definition for a custom metric.

description, string

Optional. Description for this custom dimension. Max length of 150 characters.

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.

measurementUnit, 'MEASUREMENT_UNIT_UNSPECIFIED' | 'STANDARD' | 'CURRENCY' | 'FEET' | 'METERS' | 'KILOMETERS' | 'MILES' | 'MILLISECONDS' | 'SECONDS' | 'MINUTES' | 'HOURS'

Required. The type for the custom metric's value.

name, string

Identifier. Resource name for this CustomMetric resource. Format: properties/{property}/customMetrics/{customMetric}

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.

restrictedMetricType, string[]

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.

scope, 'METRIC_SCOPE_UNSPECIFIED' | 'EVENT'

Required. Immutable. The scope of this custom metric.

Response

Successful response

GoogleAnalyticsAdminV1betaCustomMetric required

A definition for a custom metric.

description, string

Optional. Description for this custom dimension. Max length of 150 characters.

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.

measurementUnit, 'MEASUREMENT_UNIT_UNSPECIFIED' | 'STANDARD' | 'CURRENCY' | 'FEET' | 'METERS' | 'KILOMETERS' | 'MILES' | 'MILLISECONDS' | 'SECONDS' | 'MINUTES' | 'HOURS'

Required. The type for the custom metric's value.

name, string

Identifier. Resource name for this CustomMetric resource. Format: properties/{property}/customMetrics/{customMetric}

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.

restrictedMetricType, string[]

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.

scope, 'METRIC_SCOPE_UNSPECIFIED' | 'EVENT'

Required. Immutable. The scope of this custom metric.

Changes

No recorded changes to this operation across all 5 revisions of this API.