Targeting traits
Targeting traits
Advertisers target users with segment rules over the traits you send in context. Send the traits your campaigns need, or those campaigns will not match.
How targeting works
On each serve call, Meridian Ads merges your context with any traits already stored for that user_key, then checks which campaigns match. New values overwrite old ones for the same trait key.
As an integrator, your job is to pass accurate, up-to-date traits. You do not define segment rules in code; advertisers set those in the console.
Rule operators
| Op | Matches when | If trait is missing |
|---|---|---|
| eq | Trait equals value | No match |
| in | Trait equals any value in values | No match |
| range | Numeric trait is between min and max | No match |
| exists | Trait is present and not null | No match |
Rules combine with and or or inside nested children arrays. An empty segment matches everyone.
Example segment
This segment targets users in the US or Canada on the pro plan. If you omit country from context, the user will not match.
JSON
{
"op": "and",
"children": [
{
"rule": {
"trait": "country",
"op": "in",
"values": ["US", "CA"]
}
},
{
"rule": {
"trait": "plan",
"op": "eq",
"value": "pro"
}
}
]
}