# Hermoso: manage_analytics_calculated_metric · Hermoso developer docs

> Machine-readable twin of https://hermoso.ai/docs/reference/ads/manage_analytics_calculated_metric/. Generated from the shipped page. Do not edit by hand.
> Full agent guide: https://hermoso.ai/llms.txt · MCP: https://app.hermoso.ai/mcp

[Docs](https://hermoso.ai/docs/) / [Tool reference](https://hermoso.ai/docs/reference/) / [Ad campaign management](https://hermoso.ai/docs/reference/ads/) / manage_analytics_calculated_metric

# `manage_analytics_calculated_metric`

GA4 calculated metrics destructive

Area: GA4 CHANNEL GROUPS + CALCULATED METRICS · [Ad campaign management](https://hermoso.ai/docs/reference/ads/). Generated from the running MCP server, like the rest of the [tool reference](https://hermoso.ai/docs/reference/).

## Description

THE DERIVED NUMBER A MARKETER ACTUALLY REPORTS — cost per purchase, revenue per session, a margin — built from metrics GA4 already collects and then available to analytics_report like any other metric. action:'list' reads them, 'create' adds one, 'update' changes the formula, name, unit or description, 'delete' removes one (confirm-gated). THE ID IS CHOSEN ONCE AND IS PERMANENT: calculatedMetricId becomes the API name reports ask for (calcMetric:your_id), Google marks it output-only afterwards, and renaming is refused by name rather than silently ignored — so pick it deliberately. The formula takes + - * / and parentheses over metric names and plain numbers, referencing at most 5 unique custom metrics; Google answers a syntax error with the exact position. WATCH invalidMetricReference ON THE WAY BACK: a formula naming a metric this property does not collect is created happily and flagged invalid, and any report using it may fail or return unexpected numbers — report that rather than a clean success. Free.

## Parameters

Parameter Type Description

`property` required `string` NUMERIC GA4 property id, from list_analytics_properties

`action` `"list" | "create" | "update" | "delete"` defaults to 'list'

`calculatedMetricId` `string` the API name, e.g. "cost_per_purchase". Required to create and PERMANENT; for update/delete it names the metric

`displayName` `string` the name shown in GA4, max 82 characters. Required to create

`formula` `string` e.g. "advertiserAdCost / conversions". Required to create

`metricUnit` `string` STANDARD | CURRENCY | FEET | MILES | METERS | KILOMETERS | MILLISECONDS | SECONDS | MINUTES | HOURS. Required to create

`description` `string` max 4096 characters

`confirm` `boolean` must be true to actually delete

## Example call

Every required parameter is shown, filled from the schema where it gives a value and otherwise with a placeholder naming the type. Replace the placeholders with real values. The same call works on the MCP server, the CLI and `POST https://app.hermoso.ai/v1/tools/manage_analytics_calculated_metric`.

**MCP** (`tools/call`)

`{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"manage_analytics_calculated_metric","arguments":{"property":"<string>"}}}`
**CLI**

`hermoso call manage_analytics_calculated_metric --json '{"property":"<string>"}'`

## Credits

Credits are spent only on two things: running an AI model (image, video, voice, text, planning, post-production) and Ad Spy research. See [Credits & costs](https://hermoso.ai/docs/credits/).

## Related tools

- [analytics_report](https://hermoso.ai/docs/reference/ads/analytics_report/) Run a GA4 report
- [manage_analytics_channel_group](https://hermoso.ai/docs/reference/ads/manage_analytics_channel_group/) GA4 channel groups

[All 759 Ad campaign management tools](https://hermoso.ai/docs/reference/ads/) · [tools.json](https://hermoso.ai/docs/reference/tools.json)
