Tags

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

Resource representations

Represents a Google Tag Manager Tag.

{
  "path": string,
  "accountId": string,
  "containerId": string,
  "workspaceId": string,
  "tagId": string,
  "name": string,
  "type": string,
  "firingRuleId": [
    string
  ],
  "blockingRuleId": [
    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,
  "firingTriggerId": [
    string
  ],
  "blockingTriggerId": [
    string
  ],
  "setupTag": [
    {
      "tagName": string,
      "stopOnSetupFailure": boolean
    }
  ],
  "teardownTag": [
    {
      "tagName": string,
      "stopTeardownOnFailure": boolean
    }
  ],
  "parentFolderId": string,
  "tagFiringOption": string,
  "tagManagerUrl": string
}
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"
  • "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 Tag's API relative path.
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"
  • "typeUnspecified"
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"
  • "tagFiringOptionUnspecified"
  • "unlimited"
tagId string The Tag ID uniquely identifies the GTM Tag.
tagManagerUrl string Auto generated link to the tag manager UI
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
workspaceId string GTM Workspace ID.

Methods

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