Tag Manager: Update Trigger
gtm_update_triggerChange one existing trigger of a Google Tag Manager container in a draft workspace: replace its conditions (e.g. fix a Page URL filter that never matches the thank-you page), change a custom event trigger's event name, rename it or set notes. The trigger's kind cannot change; only the arguments passed change. Saved in the existing workspace the user names (ask which) and NOT published: the user reviews and publishes in Tag Manager. Requires editing to be enabled on the Tag Manager connection.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"workspace": "<workspace>",
"trigger": "<trigger>"
},
"name": "gtm_update_trigger"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | No | Replaces the notes on the trigger. Optional. | |
| trigger | Yes | The trigger to change: its name or id, as gtm_list_triggers_variables shows them. | |
| new_name | No | A new name for the trigger. Optional. | |
| container | No | The container: its public id (GTM-XXXXXXX), its name, or its API path from gtm_list_containers. May be left out when the connected login reaches exactly one container. | |
| workspace | Yes | The existing Tag Manager workspace to save the draft in, by name or id, as the user named it (gtm_list_workspaces). Ask the user which workspace to use; never pick one yourself. Nothing is published. | |
| conditions | No | Conditions that must all hold for the trigger to fire; empty or omitted means every event of the type (every page view, every click). Each compares a variable with a value. At most 20. Built-in variables like Click Classes or Page Path must be enabled in the container to be used. | |
| event_name | No | Custom event triggers: the new dataLayer event name. Optional. | |
| event_name_regex | No | With event_name: treat it as a regular expression. Default false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The trigger's name after the change. | |
| type | No | Google's type code, e.g. pageview. | |
| changed | Yes | The arguments that were applied. | |
| publicId | No | Public GTM-XXXXXXX id of the container. | |
| published | Yes | Always false: the change is a draft until a version is created and published. | |
| triggerId | Yes | Id of the trigger inside the container. | |
| conditions | Yes | Its conditions after the change, as "{{Page URL}} contains /thanks" lines. | |
| workspaceId | Yes | Id of the workspace the change was saved in. | |
| workspaceUrl | Yes | Where the user reviews, previews and publishes the workspace in Tag Manager. | |
| containerName | Yes | The container's name. | |
| containerPath | Yes | API path of the container, accounts/{a}/containers/{c}. | |
| workspaceName | Yes | Name of that workspace. |