The rules of a container. Rules evaluate to true or false during runtime. They can be used to control when a tag fires or is blocked from firing, and to control when macros in a mobile container are enabled or disabled. For more details, see the firing and disabling rules of a tag's configuration and the enabling and disabling rules of a macro's configuration, respectively.
For a list of methods for this resource, see the end of this page.
Resource representations
Represents a Google Tag Manager rule.
{ "accountId": string, "containerId": string, "ruleId": string, "name": string, "notes": string, "condition": [ { "type": string, "parameter": [ { "type": string, "key": string, "value": string, "list": [ (Parameter) ], "map": [ (Parameter) ] } ] } ], "fingerprint": string }
Property name | Value | Description | Notes |
---|---|---|---|
accountId |
string |
GTM Account ID. | |
condition[] |
list |
The list of conditions that make up this rule (implicit AND between them). | writable |
condition[].parameter[] |
list |
A list of named parameters (key/value), depending on the condition's type. Notes:
|
writable |
condition[].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 |
condition[].parameter[].list[] |
list |
This list parameter's parameters (keys will be ignored). | writable |
condition[].parameter[].map[] |
list |
This map parameter's parameters (must have keys; keys must be unique). | writable |
condition[].parameter[].type |
string |
The parameter type. Valid values are:
Acceptable values are:
|
writable |
condition[].parameter[].value |
string |
A parameter's value (may contain macro references such as "{{myMacro}}") as appropriate to the specified type. | writable |
condition[].type |
string |
The type of operator for this condition.
Acceptable values are:
|
writable |
containerId |
string |
GTM Container ID. | |
fingerprint |
string |
The fingerprint of the GTM Rule as computed at storage time. This value is recomputed whenever the rule is modified. | |
name |
string |
Rule display name. | writable |
notes |
string |
User notes on how to apply this rule in the container. | writable |
ruleId |
string |
The Rule ID uniquely identifies the GTM Rule. |
Methods
Use the methods below to create, modify, delete or retrieve rules.