# Hermoso: create_analytics_custom_metric · Hermoso developer docs

> Machine-readable twin of https://hermoso.ai/docs/reference/ads/create_analytics_custom_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/) / create_analytics_custom_metric

# `create_analytics_custom_metric`

Register a GA4 custom metric

Area: GOOGLE ANALYTICS · [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

Register an event parameter the site ALREADY SENDS as a GA4 custom METRIC, so reports can SUM or AVERAGE it. This is the other half of the pair: a custom DIMENSION makes a value something you can group BY, a custom METRIC makes it something you can TOTAL — 'order_value' as a dimension gives you a list of prices, as a metric it gives you revenue. TELL THE USER TWO THINGS BEFORE CALLING: a GA4 custom metric CANNOT be deleted, only archived, and a property is capped at 50 (125 on Analytics 360) — a duplicate or a typo permanently burns a slot, so run list_analytics_definitions first, which lists metrics beside dimensions. measurementUnit IS REQUIRED and is never guessed for you: STANDARD for a plain count or quantity, CURRENCY for money, SECONDS/MINUTES/HOURS for durations. CURRENCY additionally REQUIRES restrictedMetricType (REVENUE_DATA for money coming in, COST_DATA for money going out) and every other unit REFUSES it — both directions are refused before the call is made, because Google's own error names neither field. METRICS ARE EVENT-SCOPED ONLY, unlike dimensions, which take EVENT | USER | ITEM. Not retroactive: it collects from creation onward. The result is READ BACK from Google, never echoed from the request. Needs edit access on the property. 0 credits.

## Parameters

Parameter Type Description

`property` required `string` NUMERIC GA4 property id from list_analytics_properties — never the G-XXXXXXX Measurement ID

`parameterName` required `string` the event parameter GA4 already collects, e.g. 'order_value' — NOT the report label. Letters, digits and underscores, starting with a letter, max 40 characters

`displayName` `string` the label shown in reports; defaults to parameterName, max 82 characters

`measurementUnit` required `"STANDARD" | "CURRENCY" | "FEET" | "METERS" | "KILOMETERS" | "MILES" | "MILLISECONDS" | "SECONDS" | "MINUTES" | "HOURS"` REQUIRED — Google marks it Required and there is no safe default

`restrictedMetricType` `"COST_DATA" | "REVENUE_DATA"[]` REQUIRED when measurementUnit is CURRENCY, and refused for every other unit

`scope` `"EVENT"` EVENT is the only scope GA4 accepts for a metric, and it is immutable

`description` `string` ≤150 characters

## 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/create_analytics_custom_metric`.

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

`{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"create_analytics_custom_metric","arguments":{"property":"<string>","parameterName":"<string>","measurementUnit":"<one of the listed values>"}}}`
**CLI**

`hermoso call create_analytics_custom_metric --json '{"property":"<string>","parameterName":"<string>","measurementUnit":"<one of the listed values>"}'`

## 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

- [list_analytics_definitions](https://hermoso.ai/docs/reference/ads/list_analytics_definitions/) List a GA4 property’s key events and custom dimensions
- [delete_analytics_key_event](https://hermoso.ai/docs/reference/ads/delete_analytics_key_event/) Stop counting a GA4 event as a conversion
- [archive_analytics_custom_metric](https://hermoso.ai/docs/reference/ads/archive_analytics_custom_metric/) Archive a GA4 custom metric (one-way)
- [archive_analytics_custom_dimension](https://hermoso.ai/docs/reference/ads/archive_analytics_custom_dimension/) Archive a GA4 custom dimension
- [check_analytics_compatibility](https://hermoso.ai/docs/reference/ads/check_analytics_compatibility/) Check a GA4 report will work, before running it
- [list_analytics_metadata](https://hermoso.ai/docs/reference/ads/list_analytics_metadata/) What a GA4 property can be asked
- [create_analytics_custom_dimension](https://hermoso.ai/docs/reference/ads/create_analytics_custom_dimension/) Create a GA4 custom dimension
- [create_analytics_key_event](https://hermoso.ai/docs/reference/ads/create_analytics_key_event/) Mark a GA4 event as a key event (conversion)
- [analytics_realtime](https://hermoso.ai/docs/reference/ads/analytics_realtime/) Who is on the site right now (GA4 realtime)
- [analytics_report](https://hermoso.ai/docs/reference/ads/analytics_report/) Run a GA4 report

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