Try the MCP server for Google Analytics. Install from
GitHub, and see the
announcement for more details.
Method: properties.customMetrics.create
Stay organized with collections
Save and categorize content based on your preferences.
HTTP request
POST https://analyticsadmin.googleapis.com/v1alpha/{parent=properties/*}/customMetrics
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
parent |
string
Required. Example format: properties/1234
|
Request body
The request body contains an instance of CustomMetric
.
Response body
If successful, the response body contains a newly created instance of CustomMetric
.
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 2024-10-09 UTC.
[null,null,["Last updated 2024-10-09 UTC."],[[["\u003cp\u003eCreates a CustomMetric using an HTTP POST request to a specified endpoint.\u003c/p\u003e\n"],["\u003cp\u003eRequires specifying a parent property in the path parameter and providing a CustomMetric object in the request body.\u003c/p\u003e\n"],["\u003cp\u003eUpon successful execution, returns a newly created CustomMetric object in the response body.\u003c/p\u003e\n"],["\u003cp\u003eNeeds authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/analytics.edit\u003c/code\u003e scope.\u003c/p\u003e\n"]]],["A `CustomMetric` is created via a `POST` request to the specified URL, using gRPC Transcoding. The URL requires a `parent` path parameter, formatted as `properties/1234`. The request body includes a `CustomMetric` instance. A successful response returns the newly created `CustomMetric`. Authorization requires the `https://www.googleapis.com/auth/analytics.edit` OAuth scope. The provided elements are the HTTP request, path parameters, and request/response body.\n"],null,["- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a CustomMetric.\n\nHTTP request\n\n`POST https://analyticsadmin.googleapis.com/v1alpha/{parent=properties/*}/customMetrics`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\nPath parameters\n\n| Parameters ||\n|----------|----------------------------------------------------|\n| `parent` | `string` Required. Example format: properties/1234 |\n\nRequest body\n\nThe request body contains an instance of [CustomMetric](/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customMetrics#CustomMetric).\n\nResponse body\n\nIf successful, the response body contains a newly created instance of [CustomMetric](/analytics/devguides/config/admin/v1/rest/v1alpha/properties.customMetrics#CustomMetric).\n\nAuthorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/analytics.edit`"]]