gtm_add_event_trigger
Creates a Google Tag Manager Custom Event trigger that fires when the data layer pushes a specified event or regex, returns its ID, and reuses identical triggers.
Instructions
Create a Custom Event trigger that fires when the site pushes { event: '' } to the dataLayer (optionally a regex of several events). Returns the trigger ID. Reuses an identical existing trigger.
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>",
"eventName": "<eventName>"
},
"name": "gtm_add_event_trigger"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| regex | No | ||
| eventName | Yes | e.g. add_to_cart, or a regex like ^(add_to_cart|purchase)$ with regex=true | |
| workspace | Yes | Workspace path (accounts/…/containers/…/workspaces/…), or a container public ID like GTM-XXXX (uses its Default Workspace) |