gtm_create_trigger
Create Google Tag Manager triggers with custom conditions for pageviews, clicks, form submissions, custom events, and other event types.
Instructions
Create a trigger.
Args: trigger_type: pageview, domReady, windowLoaded, click, linkClick, formSubmission, customEvent, historyChange, scrollDepth, elementVisibility, timer, youTubeVideo, jsError. conditions: list of {variable, operator, value}. Operator is one of equals, contains, startsWith, endsWith, matchRegex, greater, less. Variable is a GTM variable reference, e.g. '{{Page URL}}'. Example: [{"variable": "{{Page URL}}", "operator": "contains", "value": "/thank-you"}] event_name: required for customEvent triggers -- the dataLayer event name.
A click or form trigger only captures useful conditions when the matching built-in variables are enabled; call enable_built_in_variables first.
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": {
"name": "<name>",
"trigger_type": "<trigger_type>"
},
"name": "gtm_create_trigger"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| confirm | No | ||
| account_id | No | ||
| conditions | No | ||
| event_name | No | ||
| container_id | No | ||
| trigger_type | Yes | ||
| workspace_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |