- HTTP request
- Path parameters
- Request body
- Response body
- Authorization Scopes
- DimensionMetadata
- MetricMetadata
- Try it!
Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 Property Identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata.
For example if a custom metric with parameter name levels_unlocked
is registered to a property, the Metadata response will contain customEvent:levels_unlocked
. Universal metadata are dimensions and metrics applicable to any property such as country
and totalUsers
.
HTTP request
GET https://analyticsdata.googleapis.com/v1alpha/{name=properties/*/metadata}
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
name |
Required. The resource name of the metadata to retrieve. This name field is specified in the URL path and not URL parameters. Property is a numeric Google Analytics GA4 Property identifier. To learn more, see where to find your Property ID. Example: properties/1234/metadata Set the Property ID to 0 for dimensions and metrics common to all properties. In this special mode, this method will not return custom dimensions and metrics. |
Request body
The request body must be empty.
Response body
If successful, the response body contains data with the following structure:
The dimensions and metrics currently accepted in reporting methods.
JSON representation | |
---|---|
{ "name": string, "dimensions": [ { object ( |
Fields | |
---|---|
name |
Resource name of this metadata. |
dimensions[] |
The dimension descriptions. |
metrics[] |
The metric descriptions. |
Authorization Scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/analytics.readonly
https://www.googleapis.com/auth/analytics
DimensionMetadata
Explains a dimension.
JSON representation | |
---|---|
{ "apiName": string, "uiName": string, "description": string, "deprecatedApiNames": [ string ], "customDefinition": boolean } |
Fields | |
---|---|
apiName |
This dimension's name. Useable in Dimension's |
uiName |
This dimension's name within the Google Analytics user interface. For example, |
description |
Description of how this dimension is used and calculated. |
deprecatedApiNames[] |
Still usable but deprecated names for this dimension. If populated, this dimension is available by either |
customDefinition |
True if the dimension is a custom dimension for this property. |
MetricMetadata
Explains a metric.
JSON representation | |
---|---|
{
"apiName": string,
"uiName": string,
"description": string,
"deprecatedApiNames": [
string
],
"type": enum ( |
Fields | |
---|---|
apiName |
A metric name. Useable in Metric's |
uiName |
This metric's name within the Google Analytics user interface. For example, |
description |
Description of how this metric is used and calculated. |
deprecatedApiNames[] |
Still usable but deprecated names for this metric. If populated, this metric is available by either |
type |
The type of this metric. |
expression |
The mathematical expression for this derived metric. Can be used in Metric's |
customDefinition |
True if the metric is a custom metric for this property. |