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, the city could be "Paris" or "New York". Requests are allowed up to 9 dimensions.
Dimension is a JSON Structure definition published by Google Analytics, describing 2 properties. It conforms to the https://json-structure.org/meta/core/v0/# meta-schema.
{
"$schema": "https://json-structure.org/meta/core/v0/#",
"$id": "https://raw.githubusercontent.com/api-evangelist/google-analytics/refs/heads/main/json-structure/data-api-dimension-structure.json",
"name": "Dimension",
"description": "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, the city could be \"Paris\" or \"New York\". Requests are allowed up to 9 dimensions.",
"type": "object",
"properties": {
"dimensionExpression": {
"description": "Used to express a dimension which is the result of a formula of multiple dimensions. Example usages: 1) lower_case(dimension) 2) concatenate(dimension1, symbol, dimension2).",
"properties": {
"concatenate": {
"description": "Used to combine dimension values to a single dimension.",
"properties": {
"delimiter": {
"description": "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\".",
"type": "string",
"example": "example_value"
},
"dimensionNames": {
"description": "Names of dimensions. The names must refer back to names in the dimensions field of the request.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"lowerCase": {
"description": "Used to convert a dimension value to a single case.",
"properties": {
"dimensionName": {
"description": "Name of a dimension. The name must refer back to a name in dimensions field of the request.",
"type": "string",
"example": "Example Name"
}
},
"type": "object"
},
"upperCase": {
"description": "Used to convert a dimension value to a single case.",
"properties": {
"dimensionName": {
"description": "Name of a dimension. The name must refer back to a name in dimensions field of the request.",
"type": "string",
"example": "Example Name"
}
},
"type": "object"
}
},
"type": "object"
},
"name": {
"description": "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 supported by core reporting methods such as `runReport` and `batchRunReports`. See [Realtime Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-api-schema#dimensions) for the list of dimension names supported by the `runRealtimeReport` method. See [Funnel Dimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/exploration-api-schema#dimensions) for the list of dimension names supported by the `runFunnelReport` method. 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`.",
"type": "string",
"example": "Example Name"
}
}
}