Variables

For a list of methods for this resource, see the end of this page.

Resource representations

Represents a Google Tag Manager variable.

{
  "accountId": string,
  "containerId": string,
  "variableId": string,
  "name": string,
  "type": string,
  "notes": string,
  "scheduleStartMs": long,
  "scheduleEndMs": long,
  "parameter": [
    {
      "type": string,
      "key": string,
      "value": string,
      "list": [
        (Parameter)
      ],
      "map": [
        (Parameter)
      ]
    }
  ],
  "enablingTriggerId": [
    string
  ],
  "disablingTriggerId": [
    string
  ],
  "fingerprint": string,
  "parentFolderId": string
}
Property name Value Description Notes
accountId string GTM Account ID.
containerId string GTM Container ID.
disablingTriggerId[] list For mobile containers only: A list of trigger IDs for disabling conditional variables; the variable is enabled if one of the enabling trigger is true while all the disabling trigger are false. Treated as an unordered set. writable
enablingTriggerId[] list For mobile containers only: A list of trigger IDs for enabling conditional variables; the variable is enabled if one of the enabling triggers is true while all the disabling triggers are false. Treated as an unordered set. writable
fingerprint string The fingerprint of the GTM Variable as computed at storage time. This value is recomputed whenever the variable is modified.
name string Variable display name. writable
notes string User notes on how to apply this variable in the container. writable
parameter[] list The variable's parameters. writable
parameter[].key string The named key that uniquely identifies a parameter. Required for top-level parameters, as well as map values. Ignored for list values. writable
parameter[].list[] list This list parameter's parameters (keys will be ignored). writable
parameter[].map[] list This map parameter's parameters (must have keys; keys must be unique). writable
parameter[].type string The parameter type. Valid values are:
  • boolean: The value represents a boolean, represented as 'true' or 'false'
  • integer: The value represents a 64-bit signed integer value, in base 10
  • list: A list of parameters should be specified
  • map: A map of parameters should be specified
  • template: The value represents any text; this can include variable references (even variable references that might return non-string types)
  • trigger_reference: The value represents a trigger, represented as the trigger id


Acceptable values are:
  • "boolean"
  • "integer"
  • "list"
  • "map"
  • "template"
  • "triggerReference"
writable
parameter[].value string A parameter's value (may contain variable references such as "{{myVariable}}") as appropriate to the specified type. writable
parentFolderId string Parent folder id.
scheduleEndMs long The end timestamp in milliseconds to schedule a variable. writable
scheduleStartMs long The start timestamp in milliseconds to schedule a variable. writable
type string GTM Variable Type. writable
variableId string The Variable ID uniquely identifies the GTM Variable.

Methods

create
Creates a GTM variable.
delete
Deletes a GTM variable.
get
Gets a GTM variable.
list
Lists all GTM variables of a container.
update
Updates a GTM variable.