試用 Google Analytics 的 MCP 伺服器。從
GitHub 安裝,詳情請參閱
公告。
REST Resource: properties.customDimensions
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
資源:自訂維度
JSON 表示法 |
{
"name": string,
"parameterName": string,
"displayName": string,
"description": string,
"scope": enum (DimensionScope ),
"disallowAdsPersonalization": boolean
} |
欄位 |
name |
string
僅供輸出。這項自訂維度資源的資源名稱。格式:properties/{property}/customDimensions/{customDimensions}
|
parameterName |
string
必要欄位。不可變動。這個自訂維度的代碼參數名稱。 如果是以使用者為範圍的維度,這會是使用者屬性名稱。如果這是以事件為範圍的維度,這會是事件參數名稱。 如果是以商品為範圍的維度,這會是電子商務項目陣列中的參數名稱。 只能使用英數字元和底線,並以英文字母開頭。以使用者為範圍的維度長度上限為 24 個字元,事件範圍維度最多 40 個字元。
|
displayName |
string
必要欄位。Analytics UI 中顯示的自訂維度名稱。長度上限為 82 個字元,可以使用英數字元、空格和底線,開頭須為英文字母。舊版系統產生的顯示名稱可能包含方括號,但更新這個欄位時一律不允許使用方括號。
|
description |
string
選用設定。此自訂維度的說明。長度上限為 150 個半形字元。
|
scope |
enum (DimensionScope )
必要欄位。不可變動。這項維度的範圍。
|
disallowAdsPersonalization |
boolean
選用設定。如果設為 true,請將這個維度設為非個人化廣告,並從廣告個人化中排除。 目前只有以使用者為範圍的自訂維度支援這項功能。
|
DimensionScope
列舉 |
DIMENSION_SCOPE_UNSPECIFIED |
範圍未知或未指定。 |
EVENT |
維度範圍是以事件為範圍。 |
USER |
以使用者為範圍的維度。 |
ITEM |
以電子商務項目的維度為範圍 |
方法 |
|
封存資源的自訂維度。 |
|
建立自訂維度。 |
|
查詢單一自訂維度。 |
|
列出資源的 CustomDimensions。 |
|
更新資源的自訂維度。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003e\u003ccode\u003eCustomDimension\u003c/code\u003e resource allows defining custom dimensions with properties like name, display name, description, scope, and ads personalization settings.\u003c/p\u003e\n"],["\u003cp\u003eThe scope of a \u003ccode\u003eCustomDimension\u003c/code\u003e can be event, user, or item, dictating which data it's associated with.\u003c/p\u003e\n"],["\u003cp\u003eYou can manage \u003ccode\u003eCustomDimensions\u003c/code\u003e through methods like create, get, list, update, and archive to control your analytics data granularity.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCustomDimensions\u003c/code\u003e utilize tagging parameters (e.g., event parameter name, user property name) to collect and organize specific data points.\u003c/p\u003e\n"]]],["Custom dimensions are defined with properties like `name`, `parameterName`, `displayName`, `description`, `scope`, and `disallowAdsPersonalization`. The `parameterName` is a tagging parameter, limited to 24-40 characters, while `displayName` is an 82-character label. `Scope` can be event, user, or item. Available methods for `CustomDimension` include `archive`, `create`, `get`, `list`, and `patch`, enabling actions such as creating, retrieving, and updating custom dimension resources.\n"],null,["# REST Resource: properties.customDimensions\n\n- [Resource: CustomDimension](#CustomDimension)\n - [JSON representation](#CustomDimension.SCHEMA_REPRESENTATION)\n- [DimensionScope](#DimensionScope)\n- [Methods](#METHODS_SUMMARY)\n\nResource: CustomDimension\n-------------------------\n\nA definition for a CustomDimension.\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"name\": string, \"parameterName\": string, \"displayName\": string, \"description\": string, \"scope\": enum (/analytics/devguides/config/admin/v1/rest/v1beta/properties.customDimensions#DimensionScope), \"disallowAdsPersonalization\": boolean } ``` |\n\n| Fields ||\n|------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Output only. Resource name for this CustomDimension resource. Format: properties/{property}/customDimensions/{customDimension} |\n| `parameterName` | `string` Required. Immutable. Tagging parameter name for this custom dimension. If this is a user-scoped dimension, then this is the user property name. If this is an event-scoped dimension, then this is the event parameter name. If this is an item-scoped dimension, then this is the parameter name found in the eCommerce items array. May only contain alphanumeric and underscore characters, starting with a letter. Max length of 24 characters for user-scoped dimensions, 40 characters for event-scoped dimensions. |\n| `displayName` | `string` Required. Display name for this custom dimension 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| `scope` | `enum (`[DimensionScope](/analytics/devguides/config/admin/v1/rest/v1beta/properties.customDimensions#DimensionScope)`)` Required. Immutable. The scope of this dimension. |\n| `disallowAdsPersonalization` | `boolean` Optional. If set to true, sets this dimension as NPA and excludes it from ads personalization. This is currently only supported by user-scoped custom dimensions. |\n\nDimensionScope\n--------------\n\nValid values for the scope of this dimension.\n\n| Enums ||\n|-------------------------------|-------------------------------------|\n| `DIMENSION_SCOPE_UNSPECIFIED` | Scope unknown or not specified. |\n| `EVENT` | Dimension scoped to an event. |\n| `USER` | Dimension scoped to a user. |\n| `ITEM` | Dimension scoped to eCommerce items |\n\n| Methods ------- ||\n|-----------------------------------------------------------------------------------------------------|-------------------------------------------|\n| ### [archive](/analytics/devguides/config/admin/v1/rest/v1beta/properties.customDimensions/archive) | Archives a CustomDimension on a property. |\n| ### [create](/analytics/devguides/config/admin/v1/rest/v1beta/properties.customDimensions/create) | Creates a CustomDimension. |\n| ### [get](/analytics/devguides/config/admin/v1/rest/v1beta/properties.customDimensions/get) | Lookup for a single CustomDimension. |\n| ### [list](/analytics/devguides/config/admin/v1/rest/v1beta/properties.customDimensions/list) | Lists CustomDimensions on a property. |\n| ### [patch](/analytics/devguides/config/admin/v1/rest/v1beta/properties.customDimensions/patch) | Updates a CustomDimension on a property. |"]]