Draft a Tag Manager tag
draft_gtm_tagCreate or update a Google Tag Manager tag in a workspace and return a preview before publishing. Requires write access; Custom HTML needs explicit permission.
Instructions
Draft creating or updating a Tag Manager tag — returns a PREVIEW.
Without tag_id this creates a tag in a workspace; with tag_id it updates the existing tag. The edit lands in the workspace and changes nothing on the site until the workspace is published. Refused unless gtm.write_enabled is set, and Custom HTML (html) is refused as well unless gtm.allow_custom_html is set. Returns the resolved workspace, the tag type, the fields that would change and a plan_id.
Tag Manager API: https://developers.google.com/tag-platform/tag-manager/api/v2
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Tag name, 1-200 characters. Required when creating a tag. | |
| notes | No | Free-form note stored on the tag. None keeps the current note. | |
| paused | No | True stores the tag paused instead of deleting it. None keeps the current state. | |
| tag_id | No | Existing tag ID to update (see list_gtm_tags). Empty creates a new tag. | |
| tag_type | No | Tag type, required when creating a tag because GTM cannot change a tag's type later: googtag, gaawe (GA4 event), awct (Ads conversion), awcc, awud, sp (Ads remarketing), gclidw, flc, fls, img, html (Custom HTML) or cvt_<id> for a Community Gallery template. | |
| parameters | No | GTM parameter dicts with at least "type" and "key", for example gaawe [{"type": "TEMPLATE", "key": "eventName", "value": "form_submit"}] or awct [{"type": "TEMPLATE", "key": "conversionId", "value": "123456789"}, {"type": "TEMPLATE", "key": "conversionLabel", "value": "AbC-dEf"}]. On update they merge by key: passed keys replace, other keys stay. | |
| workspace_id | No | Workspace to edit (see list_gtm_workspaces). Empty uses the Default Workspace, or the only workspace there is. | |
| gtm_account_id | No | Numeric GTM account ID (see list_gtm_accounts). Empty uses gtm.account_id from the config. | |
| gtm_container_id | No | Numeric GTM container ID (see list_gtm_containers). Empty uses gtm.container_id from the config. | |
| firing_trigger_ids | No | Trigger IDs that fire the tag (see list_gtm_triggers). The built-in All Pages trigger is "2147479553". | |
| blocking_trigger_ids | No | Trigger IDs that must not fire the tag. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||