Draft a Tag Manager trigger
draft_gtm_triggerDraft creating or updating a Google Tag Manager trigger and get a preview of the workspace changes, without publishing anything to the live site.
Instructions
Draft creating or updating a Tag Manager trigger — returns a PREVIEW.
Without trigger_id this creates a trigger in a workspace; with trigger_id it updates the existing one. The edit lands in the workspace and changes nothing on the site until the workspace is published. Refused unless gtm.write_enabled is set. Returns the resolved workspace, the trigger 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 | Trigger name, 1-200 characters. Required when creating a trigger. | |
| notes | No | Free-form note stored on the trigger. None keeps the current note. | |
| filters | No | GTM conditions, each a dict with "type" (EQUALS, CONTAINS, MATCH_REGEX, ...) and "parameter" (arg0 = variable, arg1 = value), for example clicks on tel: links [{"type": "CONTAINS", "parameter": [{"type": "TEMPLATE", "key": "arg0", "value": "{{Click URL}}"}, {"type": "TEMPLATE", "key": "arg1", "value": "tel:"}]}]. On update the list replaces the existing one. | |
| parameters | No | GTM parameter dicts with at least "type" and "key". On update they merge by key: passed keys replace, other keys stay. | |
| trigger_id | No | Existing trigger ID to update (see list_gtm_triggers). Empty creates a new trigger. | |
| trigger_type | No | Trigger type, required when creating a trigger and rejected on an existing one, because GTM cannot change it later: pageview, domReady, windowLoaded, click, linkClick, formSubmission, customEvent, elementVisibility, scrollDepth, youTubeVideo, historyChange, timer, jsError or triggerGroup. | |
| 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. | |
| custom_event_name | No | The dataLayer event name. Required for trigger type customEvent, rejected for every other type, and rejected on an existing trigger, where the event name sits in its custom event filter. | |
| auto_event_filters | No | Conditions on automatic event parameters, same shape as filters. On update the list replaces the existing one. | |
| custom_event_filters | No | Conditions on custom event parameters, same shape as filters. On update the list replaces the existing one. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||