REST Resource: properties.customDimensions
资源:CustomDimension
JSON 表示法 |
{
"name": string,
"parameterName": string,
"displayName": string,
"description": string,
"scope": enum (DimensionScope ),
"disallowAdsPersonalization": boolean
} |
字段 |
name |
string
仅限输出。此 CustomDimension 资源的资源名称。格式:properties/{property}/customDimensions/{customDimension}
|
parameterName |
string
必需。不可变。此自定义维度的代码植入参数名称。 如果这是用户级范围的维度,则此维度就是用户属性名称。如果这是事件级范围的维度,则为事件参数名称。 如果这是商品级范围的维度,则是电子商务 items 数组中找到的参数名称。 只能包含字母数字字符和下划线字符,且必须以字母开头。用户级范围维度的长度上限为 24 个字符,事件级范围维度的长度上限为 40 个字符。
|
displayName |
string
必需。此自定义维度的显示名称(如 Google Analytics 界面中所示)。最多 82 个字符,可包含字母数字、空格和下划线,且必须以字母开头。旧版系统生成的显示名称可以包含方括号,但对此字段进行更新时绝不允许使用方括号。
|
description |
string
可选。此自定义维度的说明。长度上限为 150 个字符。
|
scope |
enum (DimensionScope )
必需。不可变。此维度的范围。
|
disallowAdsPersonalization |
boolean
可选。如果设置为 true,则将此维度设置为 NPA,并将其从广告个性化中排除。 目前,只有用户级范围的自定义维度支持此功能。
|
DimensionScope
枚举 |
DIMENSION_SCOPE_UNSPECIFIED |
范围未知或未指定。 |
EVENT |
限定于事件的维度。 |
USER |
范围限定为用户的维度。 |
ITEM |
商品级范围的维度 |
方法 |
|
归档媒体资源上的 CustomDimension。 |
|
创建 CustomDimension。 |
|
查找单个 CustomDimension。 |
|
列出媒体资源上的 CustomDimensions。 |
|
更新媒体资源上的 CustomDimension。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-01-14。
[null,null,["最后更新时间 (UTC):2025-01-14。"],[[["`CustomDimension` resource allows defining custom dimensions with specific parameters like name, display name, description, scope, and whether it's excluded from ads personalization."],["The scope of a custom dimension can be `EVENT`, `USER`, or `ITEM`, determining the level at which the dimension is applied."],["You can manage custom dimensions using methods like `create`, `get`, `list`, `update`, and `archive` to control their lifecycle within your Google Analytics 4 property."],["Custom dimensions can be user-scoped, event-scoped or item-scoped, each with specific requirements for the parameter name used."],["The JSON representation of a `CustomDimension` includes fields for essential properties, allowing programmatic management of custom dimensions."]]],["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"]]