Trait - Segment Node
Restrict a segment to users with a specific trait value.
Trait segment nodes are used to restrict segments to users whose traits, provided by their “identify” events, satisfy a specific condition.
Example Use Case - New Users
Let’s say you want to send a welcome email to new users. You can create a segment that includes users whose createdAt
trait is a timestamp within the last 30 minutes.
Users who were created more than 30 minutes ago will not be included in this segment, or will leave the segment once that time has elapsed.
Imagine that you’re using this “new users” segment as the entry condition to a simple journey that sends a welcome email.
This has the benefit that you can safely backfill data without worrying that older users will receive the welcome email.
Path Syntax
Paths use JSON path syntax as documented in the JSONPath specification, with one deviation.
If the path starts with a $
, it is treated as a JSONPath expression. Otherwise, it is automatically prefixed with $.
. So, for example, the path $.store.book[0].title
and store.book[0].title
are equivalent.
Prefixing the path with $
is optional, but it is useful when your path contains whitespace or other characters that are not valid in JSONPath expressions. For example, the path $['property name with spaces']
is valid, but ['property name with spaces']
is not.