Create Variable
create_variableCreates a new Google Tag Manager variable in a given workspace. Specify the variable type using Tag Manager codes (v, c, jsm, k, u) and its parameters.
Instructions
Create a variable in a workspace.
Variable types are Tag Manager's internal codes: "v" is a data layer variable, "c" a constant, "jsm" custom JavaScript, "k" a first-party cookie, "u" a URL variable. Copy the shape from an existing variable via get_variable when unsure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| variable | Yes | Variable resource. Requires name and type, e.g. {"name": "DL - transaction ID", "type": "v", "parameter": [ {"type": "integer", "key": "dataLayerVersion", "value": "2"}, {"type": "template", "key": "name", "value": "ecommerce.transaction_id"}]}. | |
| 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 | |||