试用 Google Analytics 的 MCP 服务器。从
GitHub 安装,并参阅
公告了解详情。
REST Resource: properties.customDimensions
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
资源:CustomDimension
JSON 表示法 |
{
"name": string,
"parameterName": string,
"displayName": string,
"description": string,
"scope": enum (DimensionScope ),
"disallowAdsPersonalization": boolean
} |
字段 |
name |
string
仅限输出。此 CustomDimension 资源的资源名称。格式:property/{property}/customDimensions/{customDimension}
|
parameterName |
string
必需。不可变。此自定义维度的标记参数名称。 如果这是一个用户级范围的维度,则此值为用户属性名称。如果这是一个事件级范围的维度,则此值为事件参数名称。 如果这是一个商品级范围的维度,则是在“电子商务商品”数组中找到的参数名称。 只能包含字母数字字符和下划线字符(以字母开头)。用户级范围的维度的长度上限为 24 个字符,事件级范围的维度的长度上限为 40 个字符。
|
displayName |
string
必需。此自定义维度的显示名称,如 Google Analytics 界面中所示。长度上限为 82 个字符,包括字母数字、空格和下划线(以字母开头)。由系统生成的旧显示名可以包含方括号,但对此字段进行的更新将一律不允许使用方括号。
|
description |
string
可选。此自定义维度的说明。长度上限为 150 个字符。
|
scope |
enum (DimensionScope )
必需。不可变。此维度的范围。
|
disallowAdsPersonalization |
boolean
可选。如果设置为 true,则会将此维度设置为非个性化广告,并避免将其用于广告个性化。 目前,只有用户级范围的自定义维度支持此功能。
|
DimensionScope
枚举 |
DIMENSION_SCOPE_UNSPECIFIED |
范围未知或未指定。 |
EVENT |
维度的作用域限定为一个事件。 |
USER |
维度的作用域限定为某个用户。 |
ITEM |
维度范围限定为电子商务商品 |
方法 |
|
将媒体资源上的 CustomDimension 归档。 |
|
创建 CustomDimension。 |
|
查找单个 CustomDimension。 |
|
列出媒体资源的 CustomDimensions。 |
|
更新媒体资源上的 CustomDimension。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003e\u003ccode\u003eCustomDimension\u003c/code\u003e resource allows defining custom dimensions with specific parameters like name, display name, description, scope, and whether it's excluded from ads personalization.\u003c/p\u003e\n"],["\u003cp\u003eThe scope of a custom dimension can be \u003ccode\u003eEVENT\u003c/code\u003e, \u003ccode\u003eUSER\u003c/code\u003e, or \u003ccode\u003eITEM\u003c/code\u003e, determining the level at which the dimension is applied.\u003c/p\u003e\n"],["\u003cp\u003eYou can manage custom dimensions using methods like \u003ccode\u003ecreate\u003c/code\u003e, \u003ccode\u003eget\u003c/code\u003e, \u003ccode\u003elist\u003c/code\u003e, \u003ccode\u003eupdate\u003c/code\u003e, and \u003ccode\u003earchive\u003c/code\u003e to control their lifecycle within your Google Analytics 4 property.\u003c/p\u003e\n"],["\u003cp\u003eCustom dimensions can be user-scoped, event-scoped or item-scoped, each with specific requirements for the parameter name used.\u003c/p\u003e\n"],["\u003cp\u003eThe JSON representation of a \u003ccode\u003eCustomDimension\u003c/code\u003e includes fields for essential properties, allowing programmatic management of custom dimensions.\u003c/p\u003e\n"]]],["Custom dimensions are defined with properties like `name`, `parameterName`, `displayName`, `description`, `scope`, and `disallowAdsPersonalization`. The `parameterName` is a tagging parameter, while `scope` defines if it's for events, users, or items. Actions include creating, getting, listing, patching, and archiving a custom dimension. The `DimensionScope` can be `EVENT`, `USER`, or `ITEM`. `disallowAdsPersonalization` excludes the dimension from ads personalization and is only supported for user-scoped custom dimensions.\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/v1alpha/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/v1alpha/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/v1alpha/properties.customDimensions/archive) | Archives a CustomDimension on a property. |\n| ### [create](/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customDimensions/create) | Creates a CustomDimension. |\n| ### [get](/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customDimensions/get) | Lookup for a single CustomDimension. |\n| ### [list](/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customDimensions/list) | Lists CustomDimensions on a property. |\n| ### [patch](/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customDimensions/patch) | Updates a CustomDimension on a property. |"]]