Tag Manager: Enable Built-in Variables
gtm_enable_built_in_variablesEnable one or more of Google Tag Manager's built-in variables (Click URL, Click Text, Click Classes, Form ID, Page Path, Scroll Depth Threshold, …) in a draft workspace of a web container, so triggers and tags can reference them as {{Click URL}}. A click or form trigger whose condition uses a disabled built-in never fires. Types already enabled are skipped. Saved in the existing workspace the user names and NOT published. Requires the Tag Manager connection's editing permission.
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>",
"types": "<types>"
},
"name": "gtm_enable_built_in_variables"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| types | Yes | Built-in variables to enable, by Google's type: CLICK_URL, CLICK_TEXT, CLICK_CLASSES, CLICK_ID, CLICK_ELEMENT, FORM_ID, FORM_URL, PAGE_PATH, PAGE_URL, SCROLL_DEPTH_THRESHOLD, VIDEO_PERCENT, … (web container types; up to 20). | |
| container | No | The container: its public id (GTM-XXXXXXX), its name, or its API path from gtm_list_containers. May be left out when the connected login reaches exactly one container. | |
| workspace | Yes | The existing Tag Manager workspace to save the draft in, by name or id, as the user named it (gtm_list_workspaces). Ask the user which workspace to use; never pick one yourself. Nothing is published. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| enabled | Yes | Built-ins this call enabled. | |
| publicId | No | Public GTM-XXXXXXX id of the container. | |
| published | Yes | Always false: the change is a draft until a version is created and published. | |
| workspaceId | Yes | Id of the workspace the change was saved in. | |
| workspaceUrl | Yes | Where the user reviews, previews and publishes the workspace in Tag Manager. | |
| containerName | Yes | The container's name. | |
| containerPath | Yes | API path of the container, accounts/{a}/containers/{c}. | |
| workspaceName | Yes | Name of that workspace. | |
| alreadyEnabled | Yes | Types asked for that the workspace already had. |