Trigger Types Overview
The SDK supports the following trigger types:time_on_page- Shows popup after a specified time on pagescroll- Shows popup after reaching a scroll percentageclick- Shows popup after clicking a specific elementexit- Shows popup after leaving a route (deferred to next page)event- Shows popup when your application fires a custom event
Time on Page
Shows the popup after the user has been on the page for a specified duration.value: Number of seconds to wait before showing the popup- Timer starts when
autoLaunch()is called - Timer does not reset on route changes within the same session
In popup definitions,
time_on_page values are always in seconds. The SDK internally converts them to milliseconds.Scroll Trigger
Shows the popup when the user scrolls to a specific percentage of the page.value: Scroll percentage threshold (0-100)- Triggers once when threshold is reached
- Scroll percentage is calculated as:
(scrollY / (totalHeight - viewportHeight)) * 100
- Feedback on long-form content (50-75% scroll)
- Exit intent alternative for engaged readers (90% scroll)
- Mid-article engagement (25-30% scroll)
Click Trigger
Shows the popup when the user clicks on a specific DOM element.value: Theidattribute of the target element (string)- Triggers immediately when element is clicked
- Automatically removes listener after first trigger
If the element doesn’t exist when
autoLaunch() is called, the SDK waits for DOMContentLoaded and tries again.Exit Trigger
Queues a popup when the user navigates away from a matching route, then shows it on the destination page after a specified delay.value: Delay in seconds before showing popup on the new page- Uses
sessionStorageto persist queued popups across page loads - Supports all navigation types: anchor clicks,
pushState,replaceState, hash navigation
- User is on a page matching
segments.path - User navigates to a different route
- SDK queues the popup in
sessionStorage - On the new page, SDK waits for the specified delay
- Popup is shown if conditions are met
Exit Trigger Behavior Details
Exit Trigger Behavior Details
- Popup only shows if the destination URL is different from the source URL
- Popup is dropped if user navigates back to the original URL before delay expires
- Multiple exit popups can be queued, but only one will show (first eligible)
- Queue is cleared when popup is shown or conditions fail
- Works with SPAs and traditional multi-page apps
Exit triggers evaluate
segments.path against the source route (where user is leaving from), not the destination route.Event Trigger
Shows popups in response to custom events fired by your application. This is the most flexible trigger type for product-driven feedback flows.value: Custom event name (string)- Must match exactly when calling
triggerEvent(eventName) - Event names are case-sensitive
Event triggers are not automatically activated by
autoLaunch(). They only respond to explicit triggerEvent() calls from your application.Trigger Conditions
All trigger types support optional conditions that control when popups are shown:Condition Fields
| Field | Type | Description |
|---|---|---|
answered | boolean | If false, popup won’t show if user has answered the survey |
cooldownDays | number | Minimum days between popup displays |
Conditions are evaluated as an array, and all conditions must pass for the popup to show. Multiple conditions are combined with AND logic.
Path Targeting
All triggers can be restricted to specific routes usingsegments.path:
- Full URLs:
https://example.com/pricing(exact match) - Path fragments:
/pricing(matches if current URL includes this path) - Hash routes:
/#/home(matches hash-based routes) - If
segments.pathis empty or not provided, popup can trigger on any route
Path matching normalizes URLs by removing trailing slashes and
/index.html suffixes for consistent comparison.Manual Triggering
You can bypass triggers and show popups immediately using these methods:Manual triggering with
show() or showByPopupId() still respects conditions and path segments.