Skip to main content
Version: Javascript tag

Message conditions

Message conditions let you control when a message is displayed to a user based on their current context or past behavior. All conditions are evaluated with AND logic — the message is shown only when every condition is met.

You can configure conditions in the message editor under the Conditions section in the lateral panel.

Condition types

URL

Available on: JS SDK only.

Display the message based on the current page URL.

OperatorDescription
ContainsURL contains the given fragment, e.g. /pricing
Does not containURL does not contain the given fragment
EqualURL exactly matches, e.g. https://www.example.com/pricing
Not equalURL does not exactly match
RegexURL matches the given regular expression, e.g. ^/products/.*$

Screen

Available on: iOS, Android, React Native, and Flutter SDKs only.

Display the message based on the current screen name, as reported by your app through Screeb.screenTracking(...).

OperatorDescription
ContainsScreen name contains the given string
Does not containScreen name does not contain the given string
EqualScreen name exactly matches, e.g. HomeScreen
Not equalScreen name does not exactly match

Delay

Display the message after the user has spent a given number of seconds on the current page or screen.

FieldDescription
Duration (sec)Seconds to wait before displaying the message (0–9999)

Session duration

Display the message after the user has accumulated a given number of seconds on the website or app across all pages (current session).

FieldDescription
Duration (sec)Total seconds spent on the website/app (0–9999)

Scroll

Available on: JS SDK only.

Display the message when the user has scrolled past (or before) a given percentage of the current page.

OperatorDescription
Greater thanScroll position has exceeded the given percentage
Less thanScroll position is below the given percentage

Scroll to element

Available on: JS SDK only.

Display the message when a specific element enters the viewport.

FieldDescription
CSS selectorA CSS selector identifying the element, e.g. #sign-up-section

DOM element

Available on: JS SDK only.

Display the message based on the presence of a DOM element on the page.

OperatorDescription
LoadedThe element matching the CSS selector exists in the DOM
Not loadedThe element matching the CSS selector does not exist in the DOM

Event count

Display the message based on how many times a user has triggered a custom event tracked with $screeb('event.track', '...').

FieldDescription
EventsOne or more event names to match
OperatorGreater than, less than, equal to, not equal to
CountNumber of times the event was triggered

Example: display the message after the user has triggered Product added to cart more than 3 times.

tip

You can track custom events with the event.track command.

Event sequence

Display the message based on whether a user has (or has not) performed a specific list of events, in order.

FieldDescription
OperatorEqual (performed in sequence) or Not equal (not yet performed in sequence)
EventsAn ordered list of event names

Example: display the message only after the user has performed Visit Pricing, then Create Account, then Upgrade Plan in that exact order.

Combining conditions

All conditions in the list are combined with AND logic. The message is shown only when every condition is satisfied simultaneously.

Use the Add button to stack multiple conditions. Remove individual conditions with the delete (trash) icon next to each rule.

Debugging conditions

If your message is not being displayed, you can inspect which conditions are failing in the browser console:

$screeb('message.debug');

This prints each active message with its conditions and their pass/fail status. See Troubleshooting for details.