Google アナリティクスの MCP サーバーを試します。
GitHub からインストールし、詳細については
お知らせをご覧ください。
REST Resource: properties.customMetrics
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
リソース: CustomMetric
フィールド |
name |
string
出力専用。この CustomMetric リソースのリソース名。形式: properties/{property}/customMetrics/{customMetric}
|
parameterName |
string
必須。変更不可。このカスタム指標のタグ付け名。 イベント スコープの指標の場合は、イベント パラメータ名です。 使用できるのは英数字とアンダースコアのみで、先頭は英字です。イベント スコープの指標の最大文字数は 40 文字です。
|
displayName |
string
必須。アナリティクスの管理画面に表示される、このカスタム指標の表示名。最大長は 82 文字で、英数字、スペース、アンダースコアは英字で始まる必要があります。システムが生成した従来の表示名には角かっこを含めることができますが、このフィールドを更新しても角かっこは使用できません。
|
description |
string
省略可。このカスタム ディメンションの説明。最大長は 150 文字です。
|
measurementUnit |
enum (MeasurementUnit )
必須。カスタム指標の値のタイプ。
|
scope |
enum (MetricScope )
必須。変更不可。このカスタム指標のスコープ。
|
restrictedMetricType[] |
enum (RestrictedMetricType )
省略可。この指標に含まれる可能性がある制限付きデータの種類。測定単位が CURRENCY の指標では必須。測定単位が通貨ではない指標の場合は空にする必要があります。
|
MeasurementUnit
カスタム指標の値を表すタイプ。
将来、通貨の表現が変更される可能性があり、互換性を破る API の変更が必要になります。
列挙型 |
MEASUREMENT_UNIT_UNSPECIFIED |
MeasurementUnit が指定されていないか、存在しません。 |
STANDARD |
この指標ではデフォルトの単位が使用されます。 |
CURRENCY |
この指標は通貨を測定します。 |
FEET |
この指標はフィートを測定します。 |
METERS |
この指標はメートルを測定します。 |
KILOMETERS |
この指標はキロメートルを測定します。 |
MILES |
この指標はマイルを測定します。 |
MILLISECONDS |
この指標はミリ秒単位で測定されます。 |
SECONDS |
この指標は秒数を測定します。 |
MINUTES |
この指標は分を測定します。 |
HOURS |
この指標は時間を測定します。 |
MetricScope
列挙型 |
METRIC_SCOPE_UNSPECIFIED |
スコープが不明であるか、指定されていません。 |
EVENT |
イベントをスコープとする指標。 |
RestrictedMetricType
このカスタム指標のデータを、特定のユーザーに限定するデータとしてマークするラベル。
列挙型 |
RESTRICTED_METRIC_TYPE_UNSPECIFIED |
タイプが不明または未指定です。 |
COST_DATA |
指標レポートの費用データ。 |
REVENUE_DATA |
指標レポートの収益データ |
メソッド |
|
プロパティにカスタム指標をアーカイブします。 |
|
カスタム指標を作成します。 |
|
単一のカスタム指標のルックアップ。 |
|
プロパティの CustomMetrics を一覧表示します。 |
|
プロパティのカスタム指標を更新します。 |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003e\u003ccode\u003eCustomMetric\u003c/code\u003e resource allows you to define custom metrics with specific parameters, display names, descriptions, measurement units, and scopes within Google Analytics.\u003c/p\u003e\n"],["\u003cp\u003eThese custom metrics can have various measurement units like \u003ccode\u003eSTANDARD\u003c/code\u003e, \u003ccode\u003eCURRENCY\u003c/code\u003e, \u003ccode\u003eFEET\u003c/code\u003e, \u003ccode\u003eMETERS\u003c/code\u003e, and more, alongside scopes such as \u003ccode\u003eEVENT\u003c/code\u003e to tailor data collection to specific events.\u003c/p\u003e\n"],["\u003cp\u003eYou can manage your custom metrics with dedicated methods, including \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 to control their lifecycle and properties directly through the API.\u003c/p\u003e\n"],["\u003cp\u003eRestricted data like cost and revenue can be tracked by labeling the metric with specific \u003ccode\u003eRestrictedMetricType\u003c/code\u003e values, ensuring appropriate access controls.\u003c/p\u003e\n"]]],["CustomMetrics are defined by `name`, `parameterName`, `displayName`, `description`, `measurementUnit`, `scope`, and `restrictedMetricType`. `MeasurementUnit` options include standard, currency, and various distance/time units. `MetricScope` can be event-based. `RestrictedMetricType` marks data like cost or revenue. Methods allow creating, retrieving, listing, updating, and archiving custom metrics. These metrics are structured with specific field requirements, such as length and character restrictions.\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/v1beta/properties.customMetrics#MeasurementUnit), \"scope\": enum (/analytics/devguides/config/admin/v1/rest/v1beta/properties.customMetrics#MetricScope), \"restrictedMetricType\": [ enum (/analytics/devguides/config/admin/v1/rest/v1beta/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/v1beta/properties.customMetrics#MeasurementUnit)`)` Required. The type for the custom metric's value. |\n| `scope` | `enum (`[MetricScope](/analytics/devguides/config/admin/v1/rest/v1beta/properties.customMetrics#MetricScope)`)` Required. Immutable. The scope of this custom metric. |\n| `restrictedMetricType[]` | `enum (`[RestrictedMetricType](/analytics/devguides/config/admin/v1/rest/v1beta/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/v1beta/properties.customMetrics/archive) | Archives a CustomMetric on a property. |\n| ### [create](/analytics/devguides/config/admin/v1/rest/v1beta/properties.customMetrics/create) | Creates a CustomMetric. |\n| ### [get](/analytics/devguides/config/admin/v1/rest/v1beta/properties.customMetrics/get) | Lookup for a single CustomMetric. |\n| ### [list](/analytics/devguides/config/admin/v1/rest/v1beta/properties.customMetrics/list) | Lists CustomMetrics on a property. |\n| ### [patch](/analytics/devguides/config/admin/v1/rest/v1beta/properties.customMetrics/patch) | Updates a CustomMetric on a property. |"]]