Segments
A segment is a named, reusable test, what other platforms call an audience. It answers yes or no for the request being decided. A rule names it as “they are in” or “they are not in” the segment, and the rule holds or fails on the answer.
A segment stores nothing about who matched. It has no member list and no count: it is evaluated again on every request, each time something names it.
How a segment answers
Section titled “How a segment answers”A segment is a list of rules. Each rule is a list of tests, and every test in a rule has to hold for the rule to hold. The segment matches as soon as any one rule holds. The order of the rules does not change the answer.
- A segment with no rules matches nobody.
- A rule with no tests holds, so a segment with an empty rule matches everyone.
A test in a segment’s rule can be:
- a fact compared with a value, such as
user.stateispaid. See Facts; - another segment, as “they are in” or “they are not in” it;
- an experiment arm, as “they are in” or “they are not in” it. See Experiments;
- a meter, read against an allowance. A segment reads a meter and never counts against it;
- a group of tests under all of, any of or none of, one level deep.
When any test cannot be read, the segment answers an error, not a no, even if another of its rules holds. What the error does depends on where the segment is named. In a canvas entry, the canvas is not entered. In a rule inside the entered canvas, that rule does not hold, and if no other rule holds, the feature returns the canvas’s error outcome. See EdgeKit Paywall.
A profile or streaming fact with no value for this user is a miss, not an error: the rule that reads it does not hold. If no other rule of the segment holds, neither “they are in” nor “they are not in” the segment holds.
Where a segment can be named
Section titled “Where a segment can be named”- A rule in a feature’s canvas. The most common place.
- A canvas entry, only if the segment reads no meter and no experiment arm, directly or through another segment. An entry decides who a canvas is for, and a meter or an arm is a consequence of that. Staging refuses the feature, not the segment.
- An experiment’s targeting. See Experiments.
- Another segment. A segment must not name itself, directly or through other segments: the test then answers an error on every request.
A product’s coverage cannot name a segment. Coverage reads content facts only.
The Segments screen
Section titled “The Segments screen”Revenue › Decision Engine › Segments lists every segment in the draft:
- Segment: the name.
- Test: the test, written as a sentence.
- Trust floor: the weakest source of any fact the test reads, or reads no fact. See trust tiers.
- Reads: the facts the test reads. A fact fetched only when a rule names it is marked.
- Used by: the features and segments that name it, or nothing points here.
- State: live when the deployed document holds it exactly as shown, draft when it changed since the last deploy, never published when the deployed document does not hold it. not in the next deploy marks a segment left out.
Narrow the list by Trust floor, Used and Cost (whether the test reads a lazy fact), search by name or test, and sort by name, facts read or used by.
Create a segment
Section titled “Create a segment”- In Revenue › Decision Engine › Segments, select New segment.
- Under Identity, enter a Name. Rules name the segment by it, exactly as written. See names.
- Under The test, add the tests for the first rule. Select Another rule to add an alternative: the segment matches when any one rule holds.
- Read Rests on. It lists the facts the test reads and its trust floor. An unverified floor means the caller can set the answer, so do not gate access on it.
- Leave Next deploy at Left out until the segment is ready, or set it to Included. A rule that names it cannot be deployed while it is left out.
- Select Create segment. It stays disabled while the segment has no rule or a blocking error.
- Stage and deploy. See Stage and deploy a change.
Change or delete a segment
Section titled “Change or delete a segment”Open the segment from Revenue › Decision Engine › Segments. Each change you make on its screen is saved to the draft. Used by lists every feature and segment that names it: a change to the test is a change to every one of them, from the next deploy.
- Rename. The rules that name the segment keep the old name, and staging fails until you change them too.
- Delete. Under Delete this segment, select Delete segment, then Delete for good. If any record still names the segment, staging fails as a missing reference until you remove those tests.
The checks on the screen list what will refuse a deploy and what only deserves a second look, such as a test that reads a meter or an arm, a test that reads a lazy fact, or an unverified trust floor.