Visibility Rules
Sections and blocks can have conditional visibility rules. At render time, rules are evaluated against the visitor's traffic context. Only matching sections/blocks are included.
How It Works
{
"id": "visa-banner",
"type": "BannerSection",
"settings": { "text": "Exclusive 15% off with Visa" },
"visibilityRules": [
{ "field": "partner_id", "operator": "EQUALS", "value": "VISA" }
]
}
This banner only renders when the visitor's traffic context has partner_id = VISA.
Rules are AND Logic
All rules on a section/block must match. If any rule fails, the entire section/block is hidden.
"visibilityRules": [
{ "field": "partner_id", "operator": "EQUALS", "value": "VISA" },
{ "field": "loyalty_tier", "operator": "GREATER_THAN", "value": "1" }
]
This section is only visible to Visa partner visitors who are Gold tier or above.
Available Fields
| Field | Description | Example Values |
|---|---|---|
utm_source | UTM source param | google, visa_campaign |
utm_medium | UTM medium | cpc, email, social |
utm_campaign | UTM campaign name | summer_2026 |
traffic_source | Classified source | PARTNER, PAID, ORGANIC, DIRECT |
partner_id | Partner identifier | VISA, HDFC |
loyalty_tier | User's loyalty tier level | 1, 2, 3 |
device_type | Device type | MOBILE, DESKTOP, TABLET |
geo_country | Country code | IN, US |
Available Operators
| Operator | Description | Example |
|---|---|---|
EQUALS | Exact match (case-insensitive) | partner_id EQUALS VISA |
NOT_EQUALS | Not equal | traffic_source NOT_EQUALS DIRECT |
IN | Value in comma-separated list | utm_source IN google,bing,yahoo |
NOT_IN | Value not in list | partner_id NOT_IN HDFC,ICICI |
GREATER_THAN | Numeric greater than | loyalty_tier GREATER_THAN 1 |
LESS_THAN | Numeric less than | loyalty_tier LESS_THAN 5 |
CONTAINS | Substring match | utm_campaign CONTAINS summer |
STARTS_WITH | Prefix match | utm_source STARTS_WITH google |
No Rules = Always Visible
Sections/blocks without visibilityRules (null or empty) are always visible regardless of context.
Block-Level Rules
Visibility rules also work on individual blocks within a section:
{
"id": "offers-section",
"type": "OfferGrid",
"blocks": [
{
"id": "generic-offer",
"type": "OfferCard",
"settings": { "title": "10% off" }
},
{
"id": "visa-offer",
"type": "OfferCard",
"settings": { "title": "Visa 15% off" },
"visibilityRules": [
{ "field": "partner_id", "operator": "EQUALS", "value": "VISA" }
]
}
]
}
All visitors see the generic offer. Only Visa visitors see the Visa offer.