Reference documentation and code samples for the Google Analytics Data V1beta API class Google::Analytics::Data::V1beta::Dimension.
Dimensions are attributes of your data. For example, the dimension city
indicates the city from which an event originates. Dimension values in report
responses are strings; for example, city could be "Paris" or "New York".
Requests are allowed up to 9 dimensions.
(::String) — The name of the dimension. See the API
Dimensions
for the list of dimension names.
If dimensionExpression is specified, name can be any string that you
would like within the allowed character set. For example if a
dimensionExpression concatenates country and city, you could call
that dimension countryAndCity. Dimension names that you choose must match
the regular expression ^[a-zA-Z0-9_]$.
Dimensions are referenced by name in dimensionFilter, orderBys,
dimensionExpression, and pivots.
#name=
defname=(value)->::String
Parameter
value (::String) — The name of the dimension. See the API
Dimensions
for the list of dimension names.
If dimensionExpression is specified, name can be any string that you
would like within the allowed character set. For example if a
dimensionExpression concatenates country and city, you could call
that dimension countryAndCity. Dimension names that you choose must match
the regular expression ^[a-zA-Z0-9_]$.
Dimensions are referenced by name in dimensionFilter, orderBys,
dimensionExpression, and pivots.
Returns
(::String) — The name of the dimension. See the API
Dimensions
for the list of dimension names.
If dimensionExpression is specified, name can be any string that you
would like within the allowed character set. For example if a
dimensionExpression concatenates country and city, you could call
that dimension countryAndCity. Dimension names that you choose must match
the regular expression ^[a-zA-Z0-9_]$.
Dimensions are referenced by name in dimensionFilter, orderBys,
dimensionExpression, and pivots.
[[["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-09 UTC."],[],[],null,["# Google Analytics Data V1beta API - Class Google::Analytics::Data::V1beta::Dimension (v0.4.3)\n\nVersion latestkeyboard_arrow_down\n\n- [0.4.3 (latest)](/ruby/docs/reference/google-analytics-data-v1beta/latest/Google-Analytics-Data-V1beta-Dimension)\n- [0.4.2](/ruby/docs/reference/google-analytics-data-v1beta/0.4.2/Google-Analytics-Data-V1beta-Dimension) \nReference documentation and code samples for the Google Analytics Data V1beta API class Google::Analytics::Data::V1beta::Dimension.\n\nDimensions are attributes of your data. For example, the dimension city\nindicates the city from which an event originates. Dimension values in report\nresponses are strings; for example, city could be \"Paris\" or \"New York\".\nRequests are allowed up to 9 dimensions. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #dimension_expression\n\n def dimension_expression() -\u003e ::Google::Analytics::Data::V1beta::DimensionExpression\n\n**Returns**\n\n- ([::Google::Analytics::Data::V1beta::DimensionExpression](./Google-Analytics-Data-V1beta-DimensionExpression)) --- One dimension can be the result of an expression of multiple dimensions. For example, dimension \"country, city\": concatenate(country, \", \", city).\n\n### #dimension_expression=\n\n def dimension_expression=(value) -\u003e ::Google::Analytics::Data::V1beta::DimensionExpression\n\n**Parameter**\n\n- **value** ([::Google::Analytics::Data::V1beta::DimensionExpression](./Google-Analytics-Data-V1beta-DimensionExpression)) --- One dimension can be the result of an expression of multiple dimensions. For example, dimension \"country, city\": concatenate(country, \", \", city). \n**Returns**\n\n- ([::Google::Analytics::Data::V1beta::DimensionExpression](./Google-Analytics-Data-V1beta-DimensionExpression)) --- One dimension can be the result of an expression of multiple dimensions. For example, dimension \"country, city\": concatenate(country, \", \", city).\n\n### #name\n\n def name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The name of the dimension. See the [API\n Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) for the list of dimension names.\n\n\n If `dimensionExpression` is specified, `name` can be any string that you\n would like within the allowed character set. For example if a\n `dimensionExpression` concatenates `country` and `city`, you could call\n that dimension `countryAndCity`. Dimension names that you choose must match\n the regular expression `^[a-zA-Z0-9_]$`.\n\n Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`,\n `dimensionExpression`, and `pivots`.\n\n### #name=\n\n def name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The name of the dimension. See the [API\n Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) for the list of dimension names.\n\n\n If `dimensionExpression` is specified, `name` can be any string that you\n would like within the allowed character set. For example if a\n `dimensionExpression` concatenates `country` and `city`, you could call\n that dimension `countryAndCity`. Dimension names that you choose must match\n the regular expression `^[a-zA-Z0-9_]$`.\n\n Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`,\n`dimensionExpression`, and `pivots`. \n**Returns**\n\n- (::String) --- The name of the dimension. See the [API\n Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) for the list of dimension names.\n\n\n If `dimensionExpression` is specified, `name` can be any string that you\n would like within the allowed character set. For example if a\n `dimensionExpression` concatenates `country` and `city`, you could call\n that dimension `countryAndCity`. Dimension names that you choose must match\n the regular expression `^[a-zA-Z0-9_]$`.\n\n Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`,\n `dimensionExpression`, and `pivots`."]]