AI-generated Key Takeaways
-
Dimensions are attributes of your data, like city or country, and are used to categorize information in reports.
-
You can create custom dimensions by combining existing dimensions using expressions, for instance, joining city and country.
-
Dimension expressions offer functionalities such as converting case (lowercase/uppercase) and concatenating multiple dimensions.
-
Requests can include up to 8 dimensions, including those derived from expressions, to analyze your data from various perspectives.
-
Each dimension used in expressions needs to be defined within the 'dimensions' field of your data request for the expression to be valid.
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.
JSON representation | |
---|---|
{
"name": string,
"dimensionExpression": {
object ( |
Fields | |
---|---|
name |
The name of the dimension. See the API Dimensions for the list of dimension names. If Dimensions are referenced by |
dimensionExpression |
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 |
Fields | ||
---|---|---|
Union field one_expression . Specify one type of dimension expression for DimensionExpression . one_expression can be only one of the following: |
||
lowerCase |
Used to convert a dimension value to lower case. |
|
upperCase |
Used to convert a dimension value to upper case. |
|
concatenate |
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 |
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[] |
Names of dimensions. The names must refer back to names in the dimensions field of the request. |
delimiter |
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". |