hermosodocs

manage_analytics_calculated_metric

GA4 calculated metrics destructive

Area: GA4 CHANNEL GROUPS + CALCULATED METRICS · Ad campaign management. Generated from the running MCP server, like the rest of the tool 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

ParameterTypeDescription
propertyrequiredstringNUMERIC GA4 property id, from list_analytics_properties
action"list" | "create" | "update" | "delete"defaults to 'list'
calculatedMetricIdstringthe API name, e.g. "cost_per_purchase". Required to create and PERMANENT; for update/delete it names the metric
displayNamestringthe name shown in GA4, max 82 characters. Required to create
formulastringe.g. "advertiserAdCost / conversions". Required to create
metricUnitstringSTANDARD | CURRENCY | FEET | MILES | METERS | KILOMETERS | MILLISECONDS | SECONDS | MINUTES | HOURS. Required to create
descriptionstringmax 4096 characters
confirmbooleanmust 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.

All 759 Ad campaign management tools · tools.json