Segmentation
Segmentation
Segments are nested AND/OR trees over the merged profile. Missing traits fail closed. If a rule needs country=US and country is absent, the campaign does not match.
When matching runs
On each decision, Meridian Ads merges this request's context into the profile for (app_id, user_key), then evaluates the campaign's segment on that merged map. Redis is the hot copy. Postgres is durable and updated off the serve path.
Operators
| Op | Match | Missing trait |
|---|---|---|
| eq | Trait equals value | No match |
| in | Trait equals any entry in values | No match |
| range | Numeric trait between optional min and max | No match (also no match if the value is not numeric) |
| exists | Trait is present and not null | False (no match) |
Boolean nodes use and or or with nested children. Default combination is AND. An empty node (no rule, no children) matches everyone.
Example
US or CA, on the pro plan. If country is omitted, the in child fails and the whole AND fails.
JSON
{
"op": "and",
"children": [
{
"rule": {
"trait": "country",
"op": "in",
"values": ["US", "CA"]
}
},
{
"rule": {
"trait": "plan",
"op": "eq",
"value": "pro"
}
}
]
}