create_trigger
Create a trigger in a Google Tag Manager workspace draft. Provide account, container, workspace IDs, and trigger configuration to define events like pageview, click, or customEvent.
Instructions
Creates a trigger in the workspace draft.
Changes stay in the workspace until a version is published; nothing goes live. Returns the created trigger including its triggerId.
Args: account_id: Numeric account ID or full resource path. container_id: Numeric container ID or full resource path. workspace_id: Numeric workspace ID; find it via list_workspaces. trigger: Trigger resource body. Requires 'name' and 'type' (e.g. 'pageview', 'domReady', 'click', 'customEvent'). Minimal example: {'name': 'DOM Ready', 'type': 'domReady'}. A customEvent trigger also needs 'customEventFilter', e.g. [{'type': 'equals', 'parameter': [{'type': 'template', 'key': 'arg0', 'value': '{{_event}}'}, {'type': 'template', 'key': 'arg1', 'value': 'my_event'}]}].
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": {
"account_id": "<account_id>",
"container_id": "<container_id>",
"workspace_id": "<workspace_id>",
"trigger": "<trigger>"
},
"name": "create_trigger"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trigger | Yes | ||
| account_id | Yes | ||
| container_id | Yes | ||
| workspace_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||