Variables

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

Resource representations

Represents a Google Tag Manager Variable.

{
  "path": string,
  "accountId": string,
  "containerId": string,
  "workspaceId": string,
  "variableId": string,
  "name": string,
  "type": string,
  "notes": string,
  "scheduleStartMs": long,
  "scheduleEndMs": long,
  "parameter": [
    {
      "type": string,
      "key": string,
      "value": string,
      "list": [
        (Parameter)
      ],
      "map": [
        (Parameter)
      ],
      "isWeakReference": boolean
    }
  ],
  "enablingTriggerId": [
    string
  ],
  "disablingTriggerId": [
    string
  ],
  "fingerprint": string,
  "parentFolderId": string,
  "tagManagerUrl": string,
  "formatValue": {
    "caseConversionType": string,
    "convertNullToValue": {
      "type": string,
      "key": string,
      "value": string,
      "list": [
        (Parameter)
      ],
      "map": [
        (Parameter)
      ],
      "isWeakReference": boolean
    },
    "convertUndefinedToValue": {
      "type": string,
      "key": string,
      "value": string,
      "list": [
        (Parameter)
      ],
      "map": [
        (Parameter)
      ],
      "isWeakReference": boolean
    },
    "convertTrueToValue": {
      "type": string,
      "key": string,
      "value": string,
      "list": [
        (Parameter)
      ],
      "map": [
        (Parameter)
      ],
      "isWeakReference": boolean
    },
    "convertFalseToValue": {
      "type": string,
      "key": string,
      "value": string,
      "list": [
        (Parameter)
      ],
      "map": [
        (Parameter)
      ],
      "isWeakReference": boolean
    }
  }
}
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.
formatValue nested object Option to convert a variable value to other value.
formatValue.caseConversionType string The option to convert a string-type variable value to either lowercase or uppercase.

Acceptable values are:
  • "lowercase"
  • "none"
  • "uppercase"
formatValue.convertFalseToValue nested object The value to convert if a variable value is false.
formatValue.convertFalseToValue.isWeakReference boolean Whether or not a reference type parameter is strongly or weakly referenced. Only used by Transformations. writable
formatValue.convertFalseToValue.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
formatValue.convertFalseToValue.list[] list This list parameter's parameters (keys will be ignored). writable
formatValue.convertFalseToValue.map[] list This map parameter's parameters (must have keys; keys must be unique). writable
formatValue.convertFalseToValue.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
  • tag_reference: The value represents a tag, represented as the tag name


Acceptable values are:
  • "boolean"
  • "integer"
  • "list"
  • "map"
  • "tagReference"
  • "template"
  • "triggerReference"
  • "typeUnspecified"
writable
formatValue.convertFalseToValue.value string A parameter's value (may contain variable references such as "{{myVariable}}") as appropriate to the specified type. writable
formatValue.convertNullToValue nested object The value to convert if a variable value is null.
formatValue.convertNullToValue.isWeakReference boolean Whether or not a reference type parameter is strongly or weakly referenced. Only used by Transformations. writable
formatValue.convertNullToValue.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
formatValue.convertNullToValue.list[] list This list parameter's parameters (keys will be ignored). writable
formatValue.convertNullToValue.map[] list This map parameter's parameters (must have keys; keys must be unique). writable
formatValue.convertNullToValue.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
  • tag_reference: The value represents a tag, represented as the tag name


Acceptable values are:
  • "boolean"
  • "integer"
  • "list"
  • "map"
  • "tagReference"
  • "template"
  • "triggerReference"
  • "typeUnspecified"
writable
formatValue.convertNullToValue.value string A parameter's value (may contain variable references such as "{{myVariable}}") as appropriate to the specified type. writable
formatValue.convertTrueToValue nested object The value to convert if a variable value is true.
formatValue.convertTrueToValue.isWeakReference boolean Whether or not a reference type parameter is strongly or weakly referenced. Only used by Transformations. writable
formatValue.convertTrueToValue.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
formatValue.convertTrueToValue.list[] list This list parameter's parameters (keys will be ignored). writable
formatValue.convertTrueToValue.map[] list This map parameter's parameters (must have keys; keys must be unique). writable
formatValue.convertTrueToValue.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
  • tag_reference: The value represents a tag, represented as the tag name


Acceptable values are:
  • "boolean"
  • "integer"
  • "list"
  • "map"
  • "tagReference"
  • "template"
  • "triggerReference"
  • "typeUnspecified"
writable
formatValue.convertTrueToValue.value string A parameter's value (may contain variable references such as "{{myVariable}}") as appropriate to the specified type. writable
formatValue.convertUndefinedToValue nested object The value to convert if a variable value is undefined.
formatValue.convertUndefinedToValue.isWeakReference boolean Whether or not a reference type parameter is strongly or weakly referenced. Only used by Transformations. writable
formatValue.convertUndefinedToValue.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
formatValue.convertUndefinedToValue.list[] list This list parameter's parameters (keys will be ignored). writable
formatValue.convertUndefinedToValue.map[] list This map parameter's parameters (must have keys; keys must be unique). writable
formatValue.convertUndefinedToValue.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
  • tag_reference: The value represents a tag, represented as the tag name


Acceptable values are:
  • "boolean"
  • "integer"
  • "list"
  • "map"
  • "tagReference"
  • "template"
  • "triggerReference"
  • "typeUnspecified"
writable
formatValue.convertUndefinedToValue.value string A parameter's value (may contain variable references such as "{{myVariable}}") as appropriate to the specified type. writable
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[].isWeakReference boolean Whether or not a reference type parameter is strongly or weakly referenced. Only used by Transformations. 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
  • tag_reference: The value represents a tag, represented as the tag name


Acceptable values are:
  • "boolean"
  • "integer"
  • "list"
  • "map"
  • "tagReference"
  • "template"
  • "triggerReference"
  • "typeUnspecified"
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.
path string GTM Variable's API relative path.
scheduleEndMs long The end timestamp in milliseconds to schedule a variable. writable
scheduleStartMs long The start timestamp in milliseconds to schedule a variable. writable
tagManagerUrl string Auto generated link to the tag manager UI
type string GTM Variable Type. writable
variableId string The Variable ID uniquely identifies the GTM Variable.
workspaceId string GTM Workspace ID.

Methods

create
Creates a GTM Variable.
delete
Deletes a GTM Variable.
get
Gets a GTM Variable.
list
Lists all GTM Variables of a Container.
revert
Reverts changes to a GTM Variable in a GTM Workspace.
update
Updates a GTM Variable.