Control how your cloaking filters are evaluated using AND / OR logic.
โ What is Logic Operator?
The logic_operator
parameter determines how multiple targeting filters in Campaign Builder (such as country, device, OS, browser, UTM, etc.) are evaluated together.
It defines whether:
- ALL conditions must be met (AND)
- Any ONE condition is enough to pass (OR)
๐ ๏ธ Supported Values
"AND"
โ All filters must match for the visitor to see the offer page"OR"
โ Matching just one filter is enough
๐ AND vs OR โ Key Differences
Logic | Requirement | Example Match Result |
---|---|---|
AND | All filters must be true | โ country + โ device + โ OS + โ browser = MATCH |
OR | At least one filter must be true | โ country + โ device + โ OS = MATCH |
๐ How Multi-Value Filters Work
Each filter (like country, device, OS, browser) can accept multiple values, separated by |
. XCLO will evaluate whether the visitor matches at least one value in each group.
Example:
allow_browser = chrome|firefox|safari
โ A visitor using Chrome = โ matchallow_device = desktop|smartphone
โ A visitor on smartphone = โ match
But the final result depends on the logic operator:
AND
โ All filter groups must match at least one valueOR
โ Matching any one group is sufficient
๐ฌ Plain English Analogy
- Each filter group is a gate
- Each gate accepts multiple keys (allowed values)
- If a visitor has any valid key for the gate โ โ access granted for that gate
- With AND: All gates must open
- With OR: One open gate is enough
๐งพ Example Configuration in index.php
$rawConfig = [
'allow_country' => 'id|my',
'allow_device' => 'desktop|smartphone',
'allow_browser' => 'chrome|firefox',
'allow_os' => 'android',
'logic_operator' => 'AND'
];
๐ Example Debug Output
Using AND
Logic:
{
"match": false,
"reason": "OS not allowed"
}
Even though country, device, and browser match โ OS does not โ match fails.
Using OR
Logic:
{
"match": true,
"reason": "Matched: country"
}
Only country matches, but that’s enough because logic is OR.
๐ฏ When to Use AND
- High-risk campaigns (e.g., Facebook, Google, TikTok)
- Strictly targeted CPA offers
- Traffic where full compliance is mandatory
๐ฏ When to Use OR
- Testing broad traffic sources
- Push traffic or low-barrier campaigns
- When exploring conversion from different segments
โ ๏ธ Important Notes
- Use uppercase for
AND
orOR
- Do not use smart quotes (โ โ) โ use plain double quotes (“)
- Always test your config using Debug Mode before running traffic
๐ก Best Practices
- Use
AND
to filter only high-quality traffic - Use
OR
when you’re optimizing for volume - Combine with UTM logic for advanced segmentation
- Document test results to understand which filters work best