Try the MCP server for Google Analytics. Install from
GitHub, and see the
announcement for more details.
Method: properties.calculatedMetrics.create
Stay organized with collections
Save and categorize content based on your preferences.
Creates a CalculatedMetric.
HTTP request
POST https://analyticsadmin.googleapis.com/v1alpha/{parent=properties/*}/calculatedMetrics
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
parent |
string
Required. Format: properties/{property_id} Example: properties/1234
|
Query parameters
Parameters |
calculatedMetricId |
string
Required. The ID to use for the calculated metric which will become the final component of the calculated metric's resource name. This value should be 1-80 characters and valid characters are /[a-zA-Z0-9_]/, no spaces allowed. calculatedMetricId must be unique between all calculated metrics under a property. The calculatedMetricId is used when referencing this calculated metric from external APIs, for example, "calcMetric:{calculatedMetricId}".
|
Request body
The request body contains an instance of CalculatedMetric
.
Response body
If successful, the response body contains a newly created instance of CalculatedMetric
.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/analytics.edit
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-04-02 UTC.
[null,null,["Last updated 2025-04-02 UTC."],[[["Creates a new CalculatedMetric within a specified Google Analytics 4 property using an HTTP POST request."],["Requires providing a unique `calculatedMetricId` and the `property_id` as path and query parameters, respectively."],["The request body should contain the CalculatedMetric definition, and a successful response will return the newly created CalculatedMetric instance."],["Users need to have the `analytics.edit` OAuth scope to authorize this operation."]]],["This documentation details how to create a CalculatedMetric via a `POST` request to the specified URL, including required components such as path and query parameters, the request body and the response body. The path parameter `parent` defines the property ID. The query parameter `calculatedMetricId` is a unique identifier. The request and response bodies are `CalculatedMetric` instances. This action requires authorization scope: `https://www.googleapis.com/auth/analytics.edit`.\n"]]