The following table provides details of each of the operations supported by the op argument used in the definition of segments.
Operation | Description | Examples |
---|---|---|
eq (equals) | Tthe values match exactly. This is done using a JavaScript type sensitive comparison (e.g. “42” is not equal to 42) | 'foo' eq 'foo' = true |
neq (does not equal) | The values do not exactly match | 'foo' neq 'foo' = false |
lt (less than) | The numeric value in the event is less than the value in the condition | 2 lt 5 = true |
lte (less than or equal) | The numeric value in the event is less than or equal to the the value in the condition | 5 lte 5 = true |
gt (greater than) | The numeric value in the event is greater than the value in the condition | 8 gt 5 = true |
gte (greater than or equal) | The numeric value in the event is greater than or equal to the value in the condition | 5 gte 5 = true |
in | True if the value in the event is contained within the value of the condition | 'foo' in 'foo' 'bar' 'baz' = true |
nin | True if the value in the event is not contained within the value of the condition | 'foo' nin 'foo' 'bar' 'baz' = false |
contains | True if the value in the event contains the value in the condition | 'foo' 'bar' 'baz' contains 'foo' = true |
ncontains | True if the value in the event does not contain the value in the condition | 'foo' 'bar' 'baz' ncontains 'foo' = false |
containsany | The value of the condition is a list, and the condition will be true if any of the items of the list are contained in the event value |
'http://foo.com/fr/baguette' containsany '/fr', 'utm_source=email' = true 'http://foo.com' containsany 'bar.com', 'qubit.com' = false 'http://foo.com?utm_source=email' containsany 'utm_source=pidgeon' = false |
ncontainsany | The value of the condition is a list, and the condition will be true if none of the items of the list are contained in the event value |
'http://foo.com/fr/baguette' containsany '/fr', 'utm_source=email' = false 'http://foo.com' containsany 'bar.com', 'qubit.com' = true 'http://foo.com?utm_source=email' containsany 'utm_source=pidgeon' = true |
regex | Matches the regex entered |
'bar' regex /foo/ = false |
nregex | Does not match the regex entered |
'bar' nregex /foo/ = true |
WARNING: For regex and nregex, do not include the /
for the regex. When setting up the segment condition, enter value='(foo|bar|baz)'
NOT value='/(foo|bar|baz)/'
.