Reference documentation and code samples for the Google Analytics Data V1alpha Client class 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, the city could be "Paris" or "New York".
Generated from protobuf messagegoogle.analytics.data.v1alpha.Dimension
Namespace
Google \ Analytics \ Data \ V1alpha
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
The name of the dimension. See theAPI Dimensionsfor the list of dimension names supported by core reporting methods such asrunReportandbatchRunReports. SeeRealtime Dimensionsfor the list of dimension names supported by therunRealtimeReportmethod. SeeFunnel Dimensionsfor the list of dimension names supported by therunFunnelReportmethod. IfdimensionExpressionis specified,namecan be any string that you would like within the allowed character set. For example if adimensionExpressionconcatenatescountryandcity, you could call that dimensioncountryAndCity. Dimension names that you choose must match the regular expression^[a-zA-Z0-9_]$. Dimensions are referenced bynameindimensionFilter,orderBys,dimensionExpression, andpivots.
One dimension can be the result of an expression of multiple dimensions. For example, dimension "country, city": concatenate(country, ", ", city).
getName
The name of the dimension. See theAPI
Dimensionsfor the list of dimension names supported by core reporting methods such
asrunReportandbatchRunReports. SeeRealtime
Dimensionsfor the list of dimension names supported by therunRealtimeReportmethod. SeeFunnel
Dimensionsfor the list of dimension names supported by therunFunnelReportmethod.
IfdimensionExpressionis specified,namecan be any string that you
would like within the allowed character set. For example if adimensionExpressionconcatenatescountryandcity, you could call
that dimensioncountryAndCity. Dimension names that you choose must match
the regular expression^[a-zA-Z0-9_]$.
Dimensions are referenced bynameindimensionFilter,orderBys,dimensionExpression, andpivots.
Returns
Type
Description
string
setName
The name of the dimension. See theAPI
Dimensionsfor the list of dimension names supported by core reporting methods such
asrunReportandbatchRunReports. SeeRealtime
Dimensionsfor the list of dimension names supported by therunRealtimeReportmethod. SeeFunnel
Dimensionsfor the list of dimension names supported by therunFunnelReportmethod.
IfdimensionExpressionis specified,namecan be any string that you
would like within the allowed character set. For example if adimensionExpressionconcatenatescountryandcity, you could call
that dimensioncountryAndCity. Dimension names that you choose must match
the regular expression^[a-zA-Z0-9_]$.
Dimensions are referenced bynameindimensionFilter,orderBys,dimensionExpression, andpivots.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDimensionExpression
One dimension can be the result of an expression of multiple dimensions.
For example, dimension "country, city": concatenate(country, ", ", city).
[[["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 Data V1alpha Client - Class Dimension (0.22.3)\n\nVersion latestkeyboard_arrow_down\n\n- [0.22.3 (latest)](/php/docs/reference/analytics-data/latest/V1alpha.Dimension)\n- [0.22.2](/php/docs/reference/analytics-data/0.22.2/V1alpha.Dimension)\n- [0.21.1](/php/docs/reference/analytics-data/0.21.1/V1alpha.Dimension)\n- [0.20.1](/php/docs/reference/analytics-data/0.20.1/V1alpha.Dimension)\n- [0.19.0](/php/docs/reference/analytics-data/0.19.0/V1alpha.Dimension)\n- [0.18.0](/php/docs/reference/analytics-data/0.18.0/V1alpha.Dimension)\n- [0.17.1](/php/docs/reference/analytics-data/0.17.1/V1alpha.Dimension)\n- [0.16.4](/php/docs/reference/analytics-data/0.16.4/V1alpha.Dimension)\n- [0.14.0](/php/docs/reference/analytics-data/0.14.0/V1alpha.Dimension)\n- [0.13.0](/php/docs/reference/analytics-data/0.13.0/V1alpha.Dimension)\n- [0.12.0](/php/docs/reference/analytics-data/0.12.0/V1alpha.Dimension)\n- [0.11.2](/php/docs/reference/analytics-data/0.11.2/V1alpha.Dimension)\n- [0.10.1](/php/docs/reference/analytics-data/0.10.1/V1alpha.Dimension)\n- [0.9.5](/php/docs/reference/analytics-data/0.9.5/V1alpha.Dimension) \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 Data V1alpha Client class 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, the city could be \"Paris\" or \"New York\".\n\nGenerated from protobuf message `google.analytics.data.v1alpha.Dimension`\n\nNamespace\n---------\n\nGoogle \\\\ Analytics \\\\ Data \\\\ V1alpha\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nThe name of the dimension. See the [API\nDimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions)\nfor the list of dimension names supported by core reporting methods such\nas `runReport` and `batchRunReports`. See\n[Realtime\nDimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-api-schema#dimensions)\nfor the list of dimension names supported by the `runRealtimeReport`\nmethod. See\n[Funnel\nDimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/exploration-api-schema#dimensions)\nfor the list of dimension names supported by the `runFunnelReport`\nmethod.\n\nIf `dimensionExpression` is specified, `name` can be any string that you\nwould like within the allowed character set. For example if a\n`dimensionExpression` concatenates `country` and `city`, you could call\nthat dimension `countryAndCity`. Dimension names that you choose must match\nthe regular expression `^[a-zA-Z0-9_]$`.\nDimensions are referenced by `name` in `dimensionFilter`, `orderBys`,\n`dimensionExpression`, and `pivots`.\n\n### setName\n\nThe name of the dimension. See the [API\nDimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#dimensions)\nfor the list of dimension names supported by core reporting methods such\nas `runReport` and `batchRunReports`. See\n[Realtime\nDimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/realtime-api-schema#dimensions)\nfor the list of dimension names supported by the `runRealtimeReport`\nmethod. See\n[Funnel\nDimensions](https://developers.google.com/analytics/devguides/reporting/data/v1/exploration-api-schema#dimensions)\nfor the list of dimension names supported by the `runFunnelReport`\nmethod.\n\nIf `dimensionExpression` is specified, `name` can be any string that you\nwould like within the allowed character set. For example if a\n`dimensionExpression` concatenates `country` and `city`, you could call\nthat dimension `countryAndCity`. Dimension names that you choose must match\nthe regular expression `^[a-zA-Z0-9_]$`.\nDimensions are referenced by `name` in `dimensionFilter`, `orderBys`,\n`dimensionExpression`, and `pivots`.\n\n### getDimensionExpression\n\nOne dimension can be the result of an expression of multiple dimensions.\n\nFor example, dimension \"country, city\": concatenate(country, \", \", city).\n\n### hasDimensionExpression\n\n### clearDimensionExpression\n\n### setDimensionExpression\n\nOne dimension can be the result of an expression of multiple dimensions.\n\nFor example, dimension \"country, city\": concatenate(country, \", \", city)."]]