Skip to main content

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

FieldDescriptionExample Values
utm_sourceUTM source paramgoogle, visa_campaign
utm_mediumUTM mediumcpc, email, social
utm_campaignUTM campaign namesummer_2026
traffic_sourceClassified sourcePARTNER, PAID, ORGANIC, DIRECT
partner_idPartner identifierVISA, HDFC
loyalty_tierUser's loyalty tier level1, 2, 3
device_typeDevice typeMOBILE, DESKTOP, TABLET
geo_countryCountry codeIN, US

Available Operators

OperatorDescriptionExample
EQUALSExact match (case-insensitive)partner_id EQUALS VISA
NOT_EQUALSNot equaltraffic_source NOT_EQUALS DIRECT
INValue in comma-separated listutm_source IN google,bing,yahoo
NOT_INValue not in listpartner_id NOT_IN HDFC,ICICI
GREATER_THANNumeric greater thanloyalty_tier GREATER_THAN 1
LESS_THANNumeric less thanloyalty_tier LESS_THAN 5
CONTAINSSubstring matchutm_campaign CONTAINS summer
STARTS_WITHPrefix matchutm_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.