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)
    ],
    "isWeakReference": boolean
  },
  "notes": string,
  "scheduleStartMs": long,
  "scheduleEndMs": long,
  "parameter": [
    {
      "type": string,
      "key": string,
      "value": string,
      "list": [
        (Parameter)
      ],
      "map": [
        (Parameter)
      ],
      "isWeakReference": boolean
    }
  ],
  "fingerprint": string,
  "firingTriggerId": [
    string
  ],
  "blockingTriggerId": [
    string
  ],
  "setupTag": [
    {
      "tagName": string,
      "stopOnSetupFailure": boolean
    }
  ],
  "teardownTag": [
    {
      "tagName": string,
      "stopTeardownOnFailure": boolean
    }
  ],
  "parentFolderId": string,
  "tagFiringOption": string,
  "tagManagerUrl": string,
  "paused": boolean,
  "monitoringMetadata": {
    "type": string,
    "key": string,
    "value": string,
    "list": [
      (Parameter)
    ],
    "map": [
      (Parameter)
    ],
    "isWeakReference": boolean
  },
  "monitoringMetadataTagNameKey": string,
  "consentSettings": {
    "consentStatus": string,
    "consentType": {
      "type": string,
      "key": string,
      "value": string,
      "list": [
        (Parameter)
      ],
      "map": [
        (Parameter)
      ],
      "isWeakReference": 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
consentSettings nested object Consent settings of a tag. writable
consentSettings.consentStatus string The tag's consent status. If set to NEEDED, the runtime will check that the consent types specified by the consent_type field have been granted.

Acceptable values are:
  • "needed"
  • "notNeeded"
  • "notSet"
consentSettings.consentType nested object The type of consents to check for during tag firing if in the consent NEEDED state. This parameter must be of type LIST where each list item is of type STRING.
consentSettings.consentType.isWeakReference boolean Whether or not a reference type parameter is strongly or weakly referenced. Only used by Transformations. writable
consentSettings.consentType.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
consentSettings.consentType.list[] list This list parameter's parameters (keys will be ignored). writable
consentSettings.consentType.map[] list This map parameter's parameters (must have keys; keys must be unique). writable
consentSettings.consentType.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
consentSettings.consentType.value string A parameter's value (may contain variable references such as "{{myVariable}}") as appropriate to the specified type. 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
monitoringMetadata nested object A map of key-value pairs of tag metadata to be included in the event data for tag monitoring. Notes:
  • This parameter must be type MAP.
  • Each parameter in the map are type TEMPLATE, however cannot contain variable references.
writable
monitoringMetadata.isWeakReference boolean Whether or not a reference type parameter is strongly or weakly referenced. Only used by Transformations. writable
monitoringMetadata.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
monitoringMetadata.list[] list This list parameter's parameters (keys will be ignored). writable
monitoringMetadata.map[] list This map parameter's parameters (must have keys; keys must be unique). writable
monitoringMetadata.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
monitoringMetadata.value string A parameter's value (may contain variable references such as "{{myVariable}}") as appropriate to the specified type. writable
monitoringMetadataTagNameKey string If non-empty, then the tag display name will be included in the monitoring metadata map using the key specified. 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[].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 Tag's API relative path.
paused boolean Indicates whether the tag is paused, which prevents the tag from firing. 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.isWeakReference boolean Whether or not a reference type parameter is strongly or weakly referenced. Only used by Transformations. 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)
  • 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
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.