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 8 dimensions.
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. For example if a dimensionExpression concatenates country and city, you could call that dimension countryAndCity.
Dimensions are referenced by name in dimensionFilter, orderBys, dimensionExpression, and pivots.
One dimension can be the result of an expression of multiple dimensions. For example, dimension "country, city": concatenate(country, ", ", city).
DimensionExpression
Used to express a dimension which is the result of a formula of multiple dimensions. Example usages: 1) lowerCase(dimension) 2) concatenate(dimension1, symbol, dimension2).
JSON representation
{// Union field one_expression can be only one of the following:"lowerCase": {object (CaseExpression)},"upperCase": {object (CaseExpression)},"concatenate": {object (ConcatenateExpression)}// End of list of possible types for union field one_expression.}
Fields
Union field one_expression. Specify one type of dimension expression for DimensionExpression. one_expression can be only one of the following:
Used to combine dimension values to a single dimension. For example, dimension "country, city": concatenate(country, ", ", city).
CaseExpression
Used to convert a dimension value to a single case.
JSON representation
{"dimensionName": string}
Fields
dimensionName
string
Name of a dimension. The name must refer back to a name in dimensions field of the request.
ConcatenateExpression
Used to combine dimension values to a single dimension.
JSON representation
{"dimensionNames": [string],"delimiter": string}
Fields
dimensionNames[]
string
Names of dimensions. The names must refer back to names in the dimensions field of the request.
delimiter
string
The delimiter placed between dimension names.
Delimiters are often single characters such as "|" or "," but can be longer strings. If a dimension value contains the delimiter, both will be present in response with no distinction. For example if dimension 1 value = "US,FR", dimension 2 value = "JP", and delimiter = ",", then the response will contain "US,FR,JP".
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["\u003cp\u003eDimensions are attributes of your data, like city or country, and are used to categorize information in reports.\u003c/p\u003e\n"],["\u003cp\u003eYou can create custom dimensions by combining existing dimensions using expressions, for instance, joining city and country.\u003c/p\u003e\n"],["\u003cp\u003eDimension expressions offer functionalities such as converting case (lowercase/uppercase) and concatenating multiple dimensions.\u003c/p\u003e\n"],["\u003cp\u003eRequests can include up to 8 dimensions, including those derived from expressions, to analyze your data from various perspectives.\u003c/p\u003e\n"],["\u003cp\u003eEach dimension used in expressions needs to be defined within the 'dimensions' field of your data request for the expression to be valid.\u003c/p\u003e\n"]]],["The core content defines how dimensions, which are data attributes (e.g., city), can be represented and manipulated in requests. Dimensions are identified by a `name`, and can be derived from a `dimensionExpression`. These expressions include: `lowerCase` or `upperCase` that are used to adjust the case of a dimension value. The expression `concatenate` combines multiple dimension values into one, using a specified `delimiter`. These dimensions in requests can use multiple fields and refer back to the dimensions' field.\n"],null,["# Dimension\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [DimensionExpression](#DimensionExpression)\n - [JSON representation](#DimensionExpression.SCHEMA_REPRESENTATION)\n- [CaseExpression](#CaseExpression)\n - [JSON representation](#CaseExpression.SCHEMA_REPRESENTATION)\n- [ConcatenateExpression](#ConcatenateExpression)\n - [JSON representation](#ConcatenateExpression.SCHEMA_REPRESENTATION)\n\nDimensions 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 8 dimensions.\n\n| JSON representation ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"name\": string, \"dimensionExpression\": { object (/analytics/devguides/reporting/data/v1/rest/v1alpha/Dimension#DimensionExpression) } } ``` |\n\n| Fields ||\n|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` The name of the dimension. See the [API Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions) for the list of dimension names. If `dimensionExpression` is specified, `name` can be any string that you would like. For example if a `dimensionExpression` concatenates `country` and `city`, you could call that dimension `countryAndCity`. Dimensions are referenced by `name` in `dimensionFilter`, `orderBys`, `dimensionExpression`, and `pivots`. |\n| `dimensionExpression` | `object (`[DimensionExpression](/analytics/devguides/reporting/data/v1/rest/v1alpha/Dimension#DimensionExpression)`)` One dimension can be the result of an expression of multiple dimensions. For example, dimension \"country, city\": concatenate(country, \", \", city). |\n\nDimensionExpression\n-------------------\n\nUsed to express a dimension which is the result of a formula of multiple dimensions. Example usages: 1) lowerCase(dimension) 2) concatenate(dimension1, symbol, dimension2).\n\n| JSON representation ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` { // Union field `one_expression` can be only one of the following: \"lowerCase\": { object (/analytics/devguides/reporting/data/v1/rest/v1alpha/Dimension#CaseExpression) }, \"upperCase\": { object (/analytics/devguides/reporting/data/v1/rest/v1alpha/Dimension#CaseExpression) }, \"concatenate\": { object (/analytics/devguides/reporting/data/v1/rest/v1alpha/Dimension#ConcatenateExpression) } // End of list of possible types for union field `one_expression`. } ``` |\n\n| Fields ||\n|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| Union field `one_expression`. Specify one type of dimension expression for `DimensionExpression`. `one_expression` can be only one of the following: |||\n| `lowerCase` | `object (`[CaseExpression](/analytics/devguides/reporting/data/v1/rest/v1alpha/Dimension#CaseExpression)`)` Used to convert a dimension value to lower case. |\n| `upperCase` | `object (`[CaseExpression](/analytics/devguides/reporting/data/v1/rest/v1alpha/Dimension#CaseExpression)`)` Used to convert a dimension value to upper case. |\n| `concatenate` | `object (`[ConcatenateExpression](/analytics/devguides/reporting/data/v1/rest/v1alpha/Dimension#ConcatenateExpression)`)` Used to combine dimension values to a single dimension. For example, dimension \"country, city\": concatenate(country, \", \", city). |\n\nCaseExpression\n--------------\n\nUsed to convert a dimension value to a single case.\n\n| JSON representation ||\n|-------------------------------------|---|\n| ``` { \"dimensionName\": string } ``` |\n\n| Fields ||\n|-----------------|------------------------------------------------------------------------------------------------------|\n| `dimensionName` | `string` Name of a dimension. The name must refer back to a name in dimensions field of the request. |\n\nConcatenateExpression\n---------------------\n\nUsed to combine dimension values to a single dimension.\n\n| JSON representation ||\n|---------------------------------------------------------------|---|\n| ``` { \"dimensionNames\": [ string ], \"delimiter\": string } ``` |\n\n| Fields ||\n|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `dimensionNames[]` | `string` Names of dimensions. The names must refer back to names in the dimensions field of the request. |\n| `delimiter` | `string` The delimiter placed between dimension names. Delimiters are often single characters such as \"\\|\" or \",\" but can be longer strings. If a dimension value contains the delimiter, both will be present in response with no distinction. For example if dimension 1 value = \"US,FR\", dimension 2 value = \"JP\", and delimiter = \",\", then the response will contain \"US,FR,JP\". |"]]