Inputs
Output
Type:Dict
Returns the created variable as provided by the Tag Manager API, including its variableId.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Creates a user-defined variable in a Google Tag Manager workspace from a raw Variable resource payload
| App | Google Tag Manager |
| Operation ID | gtm_create_variable |
| Type | Action |
| Connection | gtm (required) |
| Credits per run | 1 |
| Agent / MCP tool | Yes |
| Requires approval | Yes (write operation) |
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
account | DynamicAccount | Yes | - | Select the Google Tag Manager account. |
container | DynamicAccount | Yes | - | Select the container. |
workspace | DynamicAccount | Yes | - | Select the workspace. |
variable_payload | object or string | Yes | - | Full Variable resource (object or JSON string) matching the Google Tag Manager API v2 Variable spec. Must include name and type (e.g. v for data layer variable, c for constant, jsm for custom JavaScript); settings go in parameter. You can copy a variable from gtm_list_variables and edit it (read-only fields are stripped automatically). Example data layer variable: {“name”: “DL - purchase value”, “type”: “v”, “parameter”: [{“type”: “integer”, “key”: “dataLayerVersion”, “value”: “2”}, {“type”: “template”, “key”: “name”, “value”: “ecommerce.value”}]} |
Dict
Returns the created variable as provided by the Tag Manager API, including its variableId.