Managing Rules¶
Rules are defined using operators that are applied on data, with and
, or
or not
conditions between them.
Supported operators and data types¶
The following are the supported operators and data types that can be filtered:
Operators¶
Operator |
Description |
---|---|
|
Contains substring (case insensitive). |
|
Does not contain substring (case insensitive). |
|
Equal to (case sensitive). |
|
Not equal to (case sensitive). |
|
Less than (for numeric fields only). |
|
Less than or equal to (for numeric fields only). |
|
Greater than (for numeric fields only). |
|
Greater than or equal to (for numeric fields only). |
|
Matches a regular expression (for example: “example.com.*purchase$”). The full PCRE grammar is supported. |
Data types¶
Data |
Description |
---|---|
|
The full URL of the site visited. |
|
The domain of the site visit. |
|
The path of the site visited (not including the domain). |
Any custom data field |
Any data sent through query parameters of a tag firing, including pre-defined “ec”, “ea”, “el” and “ev” values. Examples: productId, category, price. |
Sample rules¶
Rule: All referrer URLs containing the string “jackets” will be matched.
Example:
{
"url": {
"i_contains": "jackets"
}
}
Rule: All referrer URLs not containing the string “jackets” will be matched.
Example:
{
"url": {
"i_not_contains": "jackets"
}
}
Rule: All referrer URLs not containing the string “flowers” and “chocolate” will be matched.
Example:
{
"not": {
"and": [
{
"url": {
"i_contains": "flowers"
}
},
{
"url": {
"i_contains": "chocolate"
}
}
]
}
}
Rule: All referrer URLs containing jackets or gloves, and also containing category1
or category2
.
Example:
{
"and": [
{
"or": [
{
"url": {
"i_contains": "jackets"
}
},
{
"url": {
"i_contains": "gloves"
}
}
]
},
{
"or": [
{
"url": {
"i_contains": "category1"
}
},
{
"url": {
"i_contains": "category2"
}
}
]
}
]
}
Rule: This custom event rule will match if all of the following custom event field conditions are true: ec = ‘button’, ea = ‘click’, el = ‘Product demo’, and ev is greater than 5.
Example:
“and” :
[
{
"ec": {
"eq": "button"
}
},
{
"ea": {
"eq": "click"
}
},
{
"el": {
"eq": "Product demo"
}
},
{
"ev": {
"gt": "5"
}
},
]