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

# Update Tag

> Replaces a tag in a Google Tag Manager workspace with a full Tag resource payload

Replaces a tag in a Google Tag Manager workspace with a full Tag resource payload. Workflow: gtm\_get\_tag, edit the payload, gtm\_update\_tag, then version and publish.

| | |
| - | - |
| **App** | Google Tag Manager |
| **Operation ID** | `gtm_update_tag` |
| **Type** | Action |
| **Connection** | `gtm` (required) |
| **Credits per run** | 1 |
| **Agent / MCP tool** | Yes |
| **Requires approval** | Yes (write operation) |

## Inputs

| 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. |
| `tag` | DynamicAccount | Yes | - | Select the tag to update, or provide its tag ID. |
| `tag_payload` | object or string | Yes | - | Full replacement Tag resource (object or JSON string) matching the Google Tag Manager API v2 Tag spec; the update replaces the tag entirely, so include every field the tag should keep. Workflow: gtm\_get\_tag -> edit the payload -> gtm\_update\_tag. Read-only fields are stripped automatically. Server containers use different type codes than web containers: the server GA4 tag is 'sgtmgaaw', not 'gaawc' or 'gaawe'. An unknown code is rejected by Google as an unknown entity type, so read the exact code from gtm\_list\_tags on that container instead of guessing, or add the tag once in the Tag Manager interface and copy it back. |

## Output

**Type**: `Dict`

Returns the updated tag as provided by the Tag Manager API.


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