Operators tell Leanplum how to compare each user to your segment. For example, if you want to create a segment of users based on their App version, you could build a segment with app version greater than 5.0, less than 3.2, between 1 and 3, etc.
The tables below define all of Leanplum's operator options. Each table is organized by the type of value the operator works with (number, string, etc.).
Different types of segment criteria use different operators, and not all operators are available for all segment types. The "is greater than" operator, for example, only works with segment criteria that return numbers (e.g. is greater than 4). See Segment and target criteria options for more on segments.
For Occurrence examples, let's assume we have a shopping app with a user attribute called "rewardsLevel" that has three possible values: bronze, silver, and gold.
Value is present for this user, excluding users with no value set.
Target users with one of the three rewards statuses.
Segment criteria: User attribute > rewardsLevel > is set.
is not set
Value is not present for this user.
Target users with no rewardsLevel set.
Segment criteria: User attribute > rewardsLevel > is not set.
Equal to specific value(s).
Target just gold rewards members.
Segment criteria: User attribute >rewardsLevel > is > gold.
Everything except specific value(s).
Target bronze and silver rewards members (all except gold).
Segment criteria: User attribute >rewardsLevel > is not > gold.
is empty string
Returns users who have an attribute with no value (i.e. an empty attribute).
For Numeric Examples, let's assume our shopping app has an attribute "rewardsPoints," which requires a numeric value between 1 and 100.
is greater than
Is more than a number.
Target users who are close to reaching the next rewards level (takes 100 points).
is less than
Is less than a number.
Target users who have a long way to go before reaching the next level.
is at least
Is greater than or equal to a number.
Target users with 90 or more points.
is at most
Is less than or equal to a number.
Target users with 10 or fewer points.
Is within a specific range (including the boundary values you select).
Target mid-level users.
Because this operator is inclusive, a user with 20 points, a user with 38 points, and a user with 80 points would all evaluate as true for the segment above.
When using targets with text values, do not put brackets or quotation marks around the value (string) in your target phrase or segment search. Just use the exact characters or text for your value. Example: First Name contains a is correct, but contains "a" or contains ["a"] will not return a user named Adam. See the image below for an example of the right way to use the 'contains' operator.
Also note that text comparisons are case-insensitive. For example, given a user with a name attribute "Adam", the following segments will all return this user: "name is Adam", "name is ADAM", "name is adam".
Note on using 'contains' with arrays
For custom user attributes that contain an array of values, you must type the value exactly as it appears in the array when targeting users. For example, if you have a custom user attribute like this array —
types: ["u-type","y-type","z-type"]— you should type the whole value in your target phase like so, "User attribute types contains u-type." Typing just "contains u" will NOT work for attributes that are arrays.
Contains specific text.
Target silver and bronze rewardsLevels.
Segment criteria: User attribute > rewardsLevel > contains > e
The 'e' character will match characters in silver and bronze, but not in Gold. (See note on array-style attributes above.)
does not contain
Does not contain specific text.
Target Gold level rewards users.
Push support is on.
Push support is off.
See below for accepted formats for timing operators.
Happened after the given time.
Session start in Pacific time is after 1/2/15.
is prior to
Happened before the given time.
Session start time in user's timezone is before yesterday.
Happened at or after the given time.
Session start in user's timezone is after 1/2/15.
Happened at or before this point.
Any sessions logged before 1/2/15.
Session happened between yesterday and 08:00 AM.
Leanplum accepts many different date and time formats for use with our time-specific segment operators:
- MM/DD/YYYY → 08/05/2015
- MM/DD/YY → 08/05/15
- X months ago (weeks, days, hours, or minutes are also accepted) → 3 days ago
- MM/DD/YY XX:XX AM/PM → 5/13/16 12:01 am
- MM/DD/YY XX:XX → 5/13/16 00:00 to 5/13/16 23:59
- Yesterday, today, or tomorrow → between yesterday and today
If a date without a time is specified, the time will default to midnight (00:00) that day.
Only use inequality operators with times, such as since, prior to, and between. The operator “is” will not match any users. (An exact time, such as "is 8:00:00 AM" will pass so instantaneously that no users will be targeted).
For more in-depth examples, see Time-related targeting operators.
Updated about a year ago