ga4_create_calculated_metric
Create a GA4 calculated metric to turn custom formulas, like revenue per session, into reportable metrics; write access and explicit confirmation are required.
Instructions
[GA4 WRITE] Create a calculated metric (calculatedMetricId is required). Requires GA4_MCP_ENABLE_WRITES=true and confirm=true.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"property": "<property>",
"calculatedMetricId": "<calculatedMetricId>",
"confirm": "<confirm>"
},
"name": "ga4_create_calculated_metric"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Raw request-body object (JSON) merged OVER the typed fields — use for nested/advanced fields not exposed as flat args. | |
| confirm | Yes | Must be true to apply the change. | |
| formula | No | The calculation formula, e.g. "{{purchase_revenue}} / {{sessions}}". | |
| property | Yes | GA4 property ID, e.g. "123456789" or "properties/123456789". | |
| metricUnit | No | ||
| displayName | No | ||
| calculatedMetricId | Yes | The user-chosen id for the calculated metric (used in reporting): 1-80 letters, digits or "_". |