Restituisce i metadati per le dimensioni e le metriche disponibili nei metodi di generazione di report. Utilizzato per esplorare le dimensioni e le metriche. In questo metodo, nella richiesta viene specificato un identificatore della proprietà Google Analytics e la risposta dei metadati include le dimensioni e le metriche personalizzate, nonché i metadati universali.
Ad esempio, se una metrica personalizzata con il nome del parametro levels_unlocked è registrata in una proprietà, la risposta dei metadati conterrà customEvent:levels_unlocked. I metadati universali sono dimensioni e metriche applicabili a qualsiasi proprietà, ad esempio country e totalUsers.
Richiesta HTTP
GET https://analyticsdata.googleapis.com/v1beta/{name=properties/*/metadata}
Obbligatorio. Il nome della risorsa dei metadati da recuperare. Questo campo del nome viene specificato nel percorso dell'URL e non nei parametri URL. La proprietà è un identificatore numerico della proprietà Google Analytics. Per scoprire di più, consulta dove trovare l'ID proprietà.
Esempio: properties/1234/metadata
Imposta l'ID proprietà su 0 per le dimensioni e le metriche comuni a tutte le proprietà. In questa modalità speciale, questo metodo non restituisce dimensioni e metriche personalizzate.
Corpo della richiesta
Il corpo della richiesta deve essere vuoto.
Corpo della risposta
Le dimensioni, le metriche e i confronti attualmente accettati nei metodi di generazione di report.
In caso di esito positivo, il corpo della risposta contiene dati con la seguente struttura:
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-26 UTC."],[[["\u003cp\u003eReturns metadata for dimensions, metrics, and comparisons available in reporting methods for a specified Google Analytics GA4 Property.\u003c/p\u003e\n"],["\u003cp\u003eIncludes both custom and Universal metadata, allowing exploration of available data points.\u003c/p\u003e\n"],["\u003cp\u003eAccepts a Google Analytics GA4 Property Identifier in the request to retrieve property-specific metadata.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with specific OAuth scopes for accessing the data.\u003c/p\u003e\n"],["\u003cp\u003eProvides details about dimensions, metrics, and comparisons through comprehensive metadata descriptions.\u003c/p\u003e\n"]]],["This method retrieves metadata for dimensions, metrics, and comparisons used in Google Analytics reporting. It utilizes a `GET` HTTP request with a required property ID in the URL path (`name`) to specify the target property. An empty request body is required. The response contains a JSON structure with descriptions of available dimensions, metrics, and comparisons, including universal and custom ones. Setting the property ID to '0' will only return universal data. Two authorization scopes are required to utilize this method.\n"],null,["# Method: properties.getMetadata\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.Metadata.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [ComparisonMetadata](#ComparisonMetadata)\n - [JSON representation](#ComparisonMetadata.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nReturns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics property identifier is specified in the request, and the metadata response includes Custom dimensions and metrics as well as Universal metadata.\n\nFor 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`.\n\n### HTTP request\n\n`GET https://analyticsdata.googleapis.com/v1beta/{name=properties/*/metadata}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` 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 property identifier. To learn more, see [where to find your Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/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. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nThe dimensions, metrics and comparisons currently accepted in reporting methods.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"name\": string, \"dimensions\": [ { object (/analytics/devguides/reporting/data/v1/rest/v1beta/DimensionMetadata) } ], \"metrics\": [ { object (/analytics/devguides/reporting/data/v1/rest/v1beta/MetricMetadata) } ], \"comparisons\": [ { object (/analytics/devguides/reporting/data/v1/rest/v1beta/properties/getMetadata#ComparisonMetadata) } ] } ``` |\n\n| Fields ||\n|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Resource name of this metadata. |\n| `dimensions[]` | `object (`[DimensionMetadata](/analytics/devguides/reporting/data/v1/rest/v1beta/DimensionMetadata)`)` The dimension descriptions. |\n| `metrics[]` | `object (`[MetricMetadata](/analytics/devguides/reporting/data/v1/rest/v1beta/MetricMetadata)`)` The metric descriptions. |\n| `comparisons[]` | `object (`[ComparisonMetadata](/analytics/devguides/reporting/data/v1/rest/v1beta/properties/getMetadata#ComparisonMetadata)`)` The comparison descriptions. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/analytics.readonly`\n- `https://www.googleapis.com/auth/analytics`\n\nComparisonMetadata\n------------------\n\nThe metadata for a single comparison.\n\n| JSON representation |\n|------------------------------------------------------------------------|\n| ``` { \"apiName\": string, \"uiName\": string, \"description\": string } ``` |\n\n| Fields ||\n|---------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| `api``Name` | `string` This comparison's resource name. Useable in [Comparison](#Comparison)'s `comparison` field. For example, 'comparisons/1234'. |\n| `ui``Name` | `string` This comparison's name within the Google Analytics user interface. |\n| `description` | `string` This comparison's description. |"]]