hermosodocs

create_analytics_custom_metric

Register a GA4 custom metric

Area: GOOGLE ANALYTICS · Ad campaign management. Generated from the running MCP server, like the rest of the tool 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

ParameterTypeDescription
propertyrequiredstringNUMERIC GA4 property id from list_analytics_properties — never the G-XXXXXXX Measurement ID
parameterNamerequiredstringthe event parameter GA4 already collects, e.g. 'order_value' — NOT the report label. Letters, digits and underscores, starting with a letter, max 40 characters
displayNamestringthe label shown in reports; defaults to parameterName, max 82 characters
measurementUnitrequired"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
descriptionstring≤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.

All 759 Ad campaign management tools · tools.json