Build segments
Collect visitor sentiment

# Supported op Argument Operations

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
'foo' eq 'bar' = false

neq (does not equal)

The values do not exactly match

'foo' neq 'foo' = false
'foo' neq 'bar' = true

lt (less than)

The numeric value in the event is less than the value in the condition

2 lt 5 = true
8 lt 5 = false

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
2 lte 5 = true
8 lte 5 = false

gt (greater than)

The numeric value in the event is greater than the value in the condition

8 gt 5 = true
2 gt 5 = false

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
8 gte 5 = true
2 gte 5 = false

in

True if the value in the event is contained within the value of the condition

'foo' in 'foo' 'bar' 'baz' = true
'foo' in 'footer' = true
'bar' in 'foo' 'baz' = false
'bar' in 'footer' = false

nin

True if the value in the event is not contained within the value of the condition

'foo' nin 'foo' 'bar' 'baz' = false
'foo' nin 'footer' = false
'bar' nin 'foo' 'baz' = true
'bar' nin 'footer' = true

contains

True if the value in the event contains the value in the condition

'foo' 'bar' 'baz' contains 'foo' = true
'footer' contains 'foo' = true
'foo' 'baz' contains 'bar' = false
'footer' contains 'bar' = false

ncontains

True if the value in the event does not contain the value in the condition

'foo' 'bar' 'baz' ncontains 'foo' = false
'footer' ncontains 'foo' = false
'foo' 'baz' ncontains 'bar' = true
'footer' ncontains 'bar' = true

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' containsany 'foo.com', 'bar.com' = true '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' containsany 'foo.com', 'bar.com' = false '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

```'foo' regex /foo/ = true 'bar' regex /foo/ = false```

nregex

Does not match the regex entered

```'foo' nregex /foo/ = false '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)/'`.

Last updated: May 2020