Create Template
create_templateCreate a custom template in a Google Tag Manager workspace by providing account, container, workspace IDs and the template definition in sandboxed JavaScript format.
Instructions
Create a custom template in a workspace.
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>",
"template": "<template>"
},
"name": "create_template"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template | Yes | CustomTemplate resource, e.g. {"name": "My pixel", "templateData": "___INFO___\n..."}. templateData is the full template definition in Tag Manager's sandboxed JavaScript format, including its ___INFO___, ___TEMPLATE_PARAMETERS___ and ___SANDBOXED_JS_FOR_WEB_TEMPLATE___ sections. | |
| account_id | Yes | Numeric Tag Manager account ID. | |
| container_id | Yes | Numeric container ID. | |
| workspace_id | Yes | Numeric workspace ID. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||