Occurrence-related targeting operators

Many segments require choosing an operator (is greater than, is between, is set, contains, etc.) to tell Leanplum how to compare the specified value against the given segment. Below are all of the available segment operators for occurrences (strings and numbers) and what each of them mean.

  • is any – All possible values
  • is set – Value is present for this User
  • is not set – Value is not present for this User
  • is – Equal to specific values
  • is not – Everything except specific values
  • contains – Contains specific text
  • does not contain – Does not contain specific text
  • is greater than – Is more than a number
  • is less than – Is less than a number
  • is at least – Is greater than or equal to a number
  • is at most – Is less than or equal to a number
  • is between – Is within a specific range

Universal operators

These operators can be used with number, string, or date parameters. 

For the following examples, let's assume we have a shopping app and our code sets a user attribute called rewardsLevel with one of three possible values: Bronze, Silver, and Gold.

is any

The is any operator will target users whether they have a value set or not. So, for our shopping app example, if we wanted to target users with all three rewards statuses and any users without a status, we would add the targeting criteria User attribute > rewardsLevel > is any.

is set

The is set operator is similar to is any, but will only target users if they have a value set. For our shopping app, if we wanted to target users with one of the three rewards statuses, we would add the targeting criteria User attribute > rewardsLevel > is set.

is not set

The is not set operator is the exact opposite of is set: it will only target users if they have no value set. For our shopping app, if we wanted to target users with no rewards status, we would add the targeting criteria User attribute > rewardsLevel > is not set.

is

The is operator is the most specific, and most commonly used. It will target users if they have a specific value. For our shopping app, if we wanted to target just Gold members, we could add the targeting criteria User attribute > rewardsLevel > is > Gold.

is not

The is not operator is the exact opposite of is: it will target users if they do not have a specific value. For our shopping app, if we wanted to target Bronze and Silver members (all members except Gold), we could add the following targeting criteria User attribute > rewardsLevel > is not > Gold.

Text Operators

The following operators are only available on text parameters and attributes.

contains

The contains operator will target users if the attribute value (string) contains the string you enter. For our shopping app, another method to target Silver and Bronze members would be to add the following criteria User attribute > rewardsLevel > contains > e. This will match the "e" character in Silver and Bronze.

does not contain

The does not contain operator is the exact opposite of contains: it will target users if the attribute value (string) does not contain the string you enter. For our shopping app, another method to target Gold members would be to add the following criteria User attribute > rewardsLevel > does not contain > e.

Numeric Operators

The following operators are only available on numeric parameters and attributes. For these examples, let's assume our shopping app also has a numeric user attribute rewardsPoints (from 0 to 100) to track the number of points each user has towards their next rewards level.

is greater than

The is greater than operator will target any user with a value greater than the amount you enter. For our shopping app, if we wanted to target users that are close to reaching the next rewards level (takes 100 points), we could add the following targeting criteria User attribute > rewardsPoints > is greater than > 90

You can also pair this target with another (rewardsLevel is "Silver") to specifically target users that are close to reaching Gold status. 

is less than

The is less than operator will target any user with a value less than the amount you enter. For our shopping app, if we wanted to target users that have a long way to go before reaching the next level, we could add the following targeting criteria User attribute > rewardsPoints > is less than > 10.

is at least

The is at least operator is essentially a greater than or equal to operator: it will target any user with a value greater than or equal to the amount you enter. For our above is greater than example, if we wanted to be sure users with 90 points were included, we would add the following targeting criteria: User attribute > rewardsPoints > is at least > 90.

is at most

The is at most operator is essentially a less than or equal to operator: it will target any user with a value equal to or less than the amount you enter. For our above is less than example, if we wanted to be sure users with 10 points were included, we would add the following targeting criteria: User attribute > rewardsPoints > is at most > 10.

is between

The is between operator will target any user with a value within a range that you enter as two values. For our shopping app, if we wanted to target users between 10 and 90 points, we could add the following targeting criteria User attribute > rewardsPoints > is between > 10 > and > 90.


Was this article helpful?
Have more questions? Submit a request