Tags

The tags associated with the container. Tags are typically associated with one or more firing rules (see firingRuleId below) and optionally, with one or more blocking rules (see blockingRuleId below). When at least one firing rule evaluates to true and exactly zero blocking rules evaluate to true, the tag will fire (execute). Use the optional priority property to adjust which tags fire before others. Use the dependencies property to specify which other tags must fire and complete prior to this tag's firing. For details on the parameters that can be set for Google Tag Manager tags see the Tag Dictionary Reference.

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

Resource representations

Represents a Google Tag Manager Tag.

{
  "accountId": string,
  "containerId": string,
  "tagId": string,
  "name": string,
  "type": string,
  "firingRuleId": [
    string
  ],
  "blockingRuleId": [
    string
  ],
  "firingTriggerId": [
    string
  ],
  "blockingTriggerId": [
    string
  ],
  "liveOnly": boolean,
  "priority": {
    "type": string,
    "key": string,
    "value": string,
    "list": [
      (Parameter)
    ],
    "map": [
      (Parameter)
    ]
  },
  "notes": string,
  "scheduleStartMs": long,
  "scheduleEndMs": long,
  "parameter": [
    {
      "type": string,
      "key": string,
      "value": string,
      "list": [
        (Parameter)
      ],
      "map": [
        (Parameter)
      ]
    }
  ],
  "fingerprint": string,
  "setupTag": [
    {
      "tagName": string,
      "stopOnSetupFailure": boolean
    }
  ],
  "teardownTag": [
    {
      "tagName": string,
      "stopTeardownOnFailure": boolean
    }
  ],
  "parentFolderId": string,
  "tagFiringOption": string,
  "paused": boolean
}
Property name Value Description Notes
accountId string GTM Account ID.
blockingRuleId[] list Blocking rule IDs. If any of the listed rules evaluate to true, the tag will not fire. writable
blockingTriggerId[] list Blocking trigger IDs. If any of the listed triggers evaluate to true, the tag will not fire. writable
containerId string GTM Container ID.
fingerprint string The fingerprint of the GTM Tag as computed at storage time. This value is recomputed whenever the tag is modified.
firingRuleId[] list Firing rule IDs. A tag will fire when any of the listed rules are true and all of its blockingRuleIds (if any specified) are false. writable
firingTriggerId[] list Firing trigger IDs. A tag will fire when any of the listed triggers are true and all of its blockingTriggerIds (if any specified) are false. writable
liveOnly boolean If set to true, this tag will only fire in the live environment (e.g. not in preview or debug mode). writable
name string Tag display name. writable
notes string User notes on how to apply this tag in the container. writable
parameter[] list The tag'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)


Acceptable values are:
  • "boolean"
  • "integer"
  • "list"
  • "map"
  • "template"
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.
paused boolean True if the tag is paused. writable
priority nested object User defined numeric priority of the tag. Tags are fired asynchronously in order of priority. Tags with higher numeric value fire first. A tag's priority can be a positive or negative value. The default value is 0. writable
priority.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
priority.list[] list This list parameter's parameters (keys will be ignored). writable
priority.map[] list This map parameter's parameters (must have keys; keys must be unique). writable
priority.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)


Acceptable values are:
  • "boolean"
  • "integer"
  • "list"
  • "map"
  • "template"
writable
priority.value string A parameter's value (may contain variable references such as "{{myVariable}}") as appropriate to the specified type. writable
scheduleEndMs long The end timestamp in milliseconds to schedule a tag. writable
scheduleStartMs long The start timestamp in milliseconds to schedule a tag. writable
setupTag[] list The list of setup tags. Currently we only allow one.
setupTag[].stopOnSetupFailure boolean If true, fire the main tag if and only if the setup tag fires successfully. If false, fire the main tag regardless of setup tag firing status.
setupTag[].tagName string The name of the setup tag.
tagFiringOption string Option to fire this tag.

Acceptable values are:
  • "oncePerEvent"
  • "oncePerLoad"
  • "unlimited"
tagId string The Tag ID uniquely identifies the GTM Tag.
teardownTag[] list The list of teardown tags. Currently we only allow one.
teardownTag[].stopTeardownOnFailure boolean If true, fire the teardown tag if and only if the main tag fires successfully. If false, fire the teardown tag regardless of main tag firing status.
teardownTag[].tagName string The name of the teardown tag.
type string GTM Tag Type. writable

Methods

Use the methods below to create, modify, delete or retrieve tags.

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