Coba server MCP untuk Google Analytics. Instal dari
GitHub, dan lihat
pengumuman untuk mengetahui detail selengkapnya.
Method: properties.customMetrics.create
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Permintaan HTTP
POST https://analyticsadmin.googleapis.com/v1beta/{parent=properties/*}/customMetrics
URL menggunakan sintaksis gRPC Transcoding.
Parameter jalur
Parameter |
parent |
string
Wajib. Contoh format: properties/1234
|
Isi permintaan
Isi permintaan memuat instance CustomMetric
.
Isi respons
Jika berhasil, isi respons memuat instance CustomMetric
yang baru dibuat.
Cakupan otorisasi
Memerlukan cakupan OAuth berikut ini:
https://www.googleapis.com/auth/analytics.edit
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-26 UTC.
[null,null,["Terakhir diperbarui pada 2025-07-26 UTC."],[[["\u003cp\u003eCreates a CustomMetric using an HTTP POST request to the specified endpoint.\u003c/p\u003e\n"],["\u003cp\u003eRequires \u003ccode\u003eparent\u003c/code\u003e as a path parameter specifying the property (e.g., \u003ccode\u003eproperties/1234\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe request body should contain a CustomMetric object, as detailed in the provided link.\u003c/p\u003e\n"],["\u003cp\u003eA successful response will return the newly created CustomMetric object.\u003c/p\u003e\n"],["\u003cp\u003eRequires the \u003ccode\u003ehttps://www.googleapis.com/auth/analytics.edit\u003c/code\u003e OAuth scope for authorization.\u003c/p\u003e\n"]]],["This document details how to create a CustomMetric using a POST request to the specified URL: `https://analyticsadmin.googleapis.com/v1beta/{parent=properties/*}/customMetrics`. The `parent` path parameter is required, formatted as \"properties/1234\". The request body must include a `CustomMetric` instance, and a successful response will return a newly created `CustomMetric` instance. The request requires the `https://www.googleapis.com/auth/analytics.edit` authorization scope.\n"],null,["# Method: properties.customMetrics.create\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- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a CustomMetric.\n\n### HTTP request\n\n`POST https://analyticsadmin.googleapis.com/v1beta/{parent=properties/*}/customMetrics`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|----------------------------------------------------|\n| `parent` | `string` Required. Example format: properties/1234 |\n\n### Request body\n\nThe request body contains an instance of [CustomMetric](/analytics/devguides/config/admin/v1/rest/v1beta/properties.customMetrics#CustomMetric).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [CustomMetric](/analytics/devguides/config/admin/v1/rest/v1beta/properties.customMetrics#CustomMetric).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/analytics.edit`"]]