> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markifact.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage Custom Metrics

> Creates a Google Analytics 4 custom metric from a numeric event parameter with its measurement unit, updates its display name, description or restricted data types, or archives it

Creates a Google Analytics 4 custom metric from a numeric event parameter with its measurement unit, updates its display name, description or restricted data types, or archives it. Custom metrics cannot be deleted, only archived.

| | |
| - | - |
| **App** | GA4 |
| **Operation ID** | `ga4_manage_custom_metrics` |
| **Type** | Action |
| **Connection** | `ga4` (required) |
| **Credits per run** | 1 |
| **Agent / MCP tool** | Yes |
| **Requires approval** | Yes (write operation) |

## Inputs

| Field | Type | Required | Default | Description |
| - | - | - | - | - |
| `account` | array (also accepts a comma-separated string) | No | - | The GA4 property to change. Only one property at a time. |
| `action` | string or SelectableOption | Yes | - | 'create' registers a numeric event parameter as a custom metric so it can be reported on; 'update' changes its display name, description or restricted data types; 'archive' retires it (custom metrics cannot be deleted). Options: 'create', 'update', 'archive'. |
| `parameter_name` | string | Yes | - | The event parameter name as sent in the tag, e.g. 'video\_seconds'. Event scope only. Cannot be changed after creation. |
| `display_name` | string | No | - | Name shown in GA4 reports, e.g. 'Video Seconds'. Required on create. |
| `measurement_unit` | string or SelectableOption | No | - | Unit of the metric's value, required on create and fixed afterwards: 'STANDARD' (plain number), 'CURRENCY', 'FEET', 'METERS', 'KILOMETERS', 'MILES', 'MILLISECONDS', 'SECONDS', 'MINUTES', 'HOURS'. |
| `restricted_metric_type` | string or array of string | No | - | Only for 'CURRENCY' metrics, where Google requires it: 'COST\_DATA', 'REVENUE\_DATA' or both. Must be empty for any other unit. |
| `description` | string | No | - | Optional description shown in the GA4 admin (max 150 chars). |

### SelectableOption

| Field | Type | Required | Default | Description |
| - | - | - | - | - |
| `value` | string | Yes | - | |
| `label` | string | Yes | - | |

## Output

**Type**: `Dict`

Returns the saved custom metric: id, parameter name, display name, measurement unit and restricted types.

**Fields**: `property_id`, `status`, `custom_metric_id`, `parameter_name`, `display_name`, `measurement_unit`, `restricted_metric_type`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.