Reference documentation and code samples for the Google Analytics Admin V1alpha Client class CustomDimension.
A definition for a CustomDimension.
Generated from protobuf message google.analytics.admin.v1alpha.CustomDimension
Namespace
Google \ Analytics \ Admin \ V1alpha
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Output only. Resource name for this CustomDimension resource. Format: properties/{property}/customDimensions/{customDimension}
↳ parameter_name
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.
↳ display_name
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.
↳ description
string
Optional. Description for this custom dimension. Max length of 150 characters.
↳ scope
int
Required. Immutable. The scope of this dimension.
↳ disallow_ads_personalization
bool
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.
getName
Output only. Resource name for this CustomDimension resource.
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.
Returns
Type
Description
string
setParameterName
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.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDisplayName
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.
Returns
Type
Description
string
setDisplayName
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.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDescription
Optional. Description for this custom dimension. Max length of 150
characters.
Returns
Type
Description
string
setDescription
Optional. Description for this custom dimension. Max length of 150
characters.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getScope
Required. Immutable. The scope of this dimension.
Returns
Type
Description
int
setScope
Required. Immutable. The scope of this dimension.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getDisallowAdsPersonalization
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.
Returns
Type
Description
bool
setDisallowAdsPersonalization
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Analytics Admin V1alpha Client - Class CustomDimension (0.29.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.29.1 (latest)](/php/docs/reference/analytics-admin/latest/V1alpha.CustomDimension)\n- [0.29.0](/php/docs/reference/analytics-admin/0.29.0/V1alpha.CustomDimension)\n- [0.28.1](/php/docs/reference/analytics-admin/0.28.1/V1alpha.CustomDimension)\n- [0.27.0](/php/docs/reference/analytics-admin/0.27.0/V1alpha.CustomDimension)\n- [0.26.0](/php/docs/reference/analytics-admin/0.26.0/V1alpha.CustomDimension)\n- [0.25.2](/php/docs/reference/analytics-admin/0.25.2/V1alpha.CustomDimension)\n- [0.24.2](/php/docs/reference/analytics-admin/0.24.2/V1alpha.CustomDimension)\n- [0.23.0](/php/docs/reference/analytics-admin/0.23.0/V1alpha.CustomDimension)\n- [0.22.5](/php/docs/reference/analytics-admin/0.22.5/V1alpha.CustomDimension)\n- [0.20.0](/php/docs/reference/analytics-admin/0.20.0/V1alpha.CustomDimension)\n- [0.19.0](/php/docs/reference/analytics-admin/0.19.0/V1alpha.CustomDimension)\n- [0.18.1](/php/docs/reference/analytics-admin/0.18.1/V1alpha.CustomDimension)\n- [0.17.0](/php/docs/reference/analytics-admin/0.17.0/V1alpha.CustomDimension)\n- [0.16.0](/php/docs/reference/analytics-admin/0.16.0/V1alpha.CustomDimension)\n- [0.15.1](/php/docs/reference/analytics-admin/0.15.1/V1alpha.CustomDimension)\n- [0.14.0](/php/docs/reference/analytics-admin/0.14.0/V1alpha.CustomDimension)\n- [0.13.0](/php/docs/reference/analytics-admin/0.13.0/V1alpha.CustomDimension)\n- [0.12.0](/php/docs/reference/analytics-admin/0.12.0/V1alpha.CustomDimension)\n- [0.11.1](/php/docs/reference/analytics-admin/0.11.1/V1alpha.CustomDimension)\n- [0.10.0](/php/docs/reference/analytics-admin/0.10.0/V1alpha.CustomDimension)\n- [0.9.0](/php/docs/reference/analytics-admin/0.9.0/V1alpha.CustomDimension)\n- [0.8.2](/php/docs/reference/analytics-admin/0.8.2/V1alpha.CustomDimension) \n| **Beta**\n|\n|\n| This library is covered by the [Pre-GA Offerings Terms](/terms/service-terms#1)\n| of the Terms of Service. Pre-GA libraries might have limited support,\n| and changes to pre-GA libraries might not be compatible with other pre-GA versions.\n| For more information, see the\n[launch stage descriptions](/products#product-launch-stages). \nReference documentation and code samples for the Google Analytics Admin V1alpha Client class CustomDimension.\n\nA definition for a CustomDimension.\n\nGenerated from protobuf message `google.analytics.admin.v1alpha.CustomDimension`\n\nNamespace\n---------\n\nGoogle \\\\ Analytics \\\\ Admin \\\\ V1alpha\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nOutput only. Resource name for this CustomDimension resource.\n\nFormat: properties/{property}/customDimensions/{customDimension}\n\n### setName\n\nOutput only. Resource name for this CustomDimension resource.\n\nFormat: properties/{property}/customDimensions/{customDimension}\n\n### getParameterName\n\nRequired. Immutable. Tagging parameter name for this custom dimension.\n\nIf this is a user-scoped dimension, then this is the user property name.\nIf this is an event-scoped dimension, then this is the event parameter\nname.\nIf this is an item-scoped dimension, then this is the parameter\nname found in the eCommerce items array.\nMay only contain alphanumeric and underscore characters, starting with a\nletter. Max length of 24 characters for user-scoped dimensions, 40\ncharacters for event-scoped dimensions.\n\n### setParameterName\n\nRequired. Immutable. Tagging parameter name for this custom dimension.\n\nIf this is a user-scoped dimension, then this is the user property name.\nIf this is an event-scoped dimension, then this is the event parameter\nname.\nIf this is an item-scoped dimension, then this is the parameter\nname found in the eCommerce items array.\nMay only contain alphanumeric and underscore characters, starting with a\nletter. Max length of 24 characters for user-scoped dimensions, 40\ncharacters for event-scoped dimensions.\n\n### getDisplayName\n\nRequired. Display name for this custom dimension as shown in the Analytics\nUI. Max length of 82 characters, alphanumeric plus space and underscore\nstarting with a letter. Legacy system-generated display names may contain\nsquare brackets, but updates to this field will never permit square\nbrackets.\n\n### setDisplayName\n\nRequired. Display name for this custom dimension as shown in the Analytics\nUI. Max length of 82 characters, alphanumeric plus space and underscore\nstarting with a letter. Legacy system-generated display names may contain\nsquare brackets, but updates to this field will never permit square\nbrackets.\n\n### getDescription\n\nOptional. Description for this custom dimension. Max length of 150\ncharacters.\n\n### setDescription\n\nOptional. Description for this custom dimension. Max length of 150\ncharacters.\n\n### getScope\n\nRequired. Immutable. The scope of this dimension.\n\n### setScope\n\nRequired. Immutable. The scope of this dimension.\n\n### getDisallowAdsPersonalization\n\nOptional. If set to true, sets this dimension as NPA and excludes it from\nads personalization.\n\nThis is currently only supported by user-scoped custom dimensions.\n\n### setDisallowAdsPersonalization\n\nOptional. If set to true, sets this dimension as NPA and excludes it from\nads personalization.\n\nThis is currently only supported by user-scoped custom dimensions."]]