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.
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 |