TriggerConfig is exported from the package and can be imported. The other types on this page (PopupTriggerType, PopupTriggerCondition, PopupTrigger) are used internally and documented here for reference.TriggerConfig
Options for configuring survey triggers.Parameters
Trigger type:
- time: Delay trigger (milliseconds)
- scroll: Scroll percentage trigger
- exit: Route exit trigger
- click: Element click trigger (by id)
- event: Custom host event trigger
Value for the trigger:
- time: milliseconds to wait
- scroll: scroll percentage (0-100)
- exit: seconds before route exit
- click: element id to watch
- event: custom event name
Survey ID to show when triggered
Optional popup definition id (used to disambiguate repeated survey ids)
PopupTriggerType
Specific trigger type for remote popup definitions.Trigger Types
Trigger after user has been on page for a specified duration
Trigger when user scrolls to a specific percentage of the page
Trigger when user attempts to exit or navigate away from the page
Trigger when user clicks a specific element
Trigger on a custom event dispatched by the host application
PopupTriggerCondition
Additional condition for popup activation.Properties
Whether the user has already answered the survey. If
true, the popup will not be shown (unless cooldown has expired)Number of days to wait before showing the popup again after user interaction
PopupTrigger
Trigger associated with popup definition (used inPopupDefinition).
Properties
Type of trigger to use
Value configuration for the trigger:
- time_on_page: seconds on page (number)
- scroll: scroll percentage 0-100 (number)
- exit: seconds before exit (number)
- click: element id (string)
- event: custom event name (string)
List of additional conditions that must be met for the popup to trigger
Example Usage
Trigger Type Comparison
| Trigger Type | Value Type | Use Case | Example Value |
|---|---|---|---|
time / time_on_page | number | Delay after page load | 5000 (5 seconds) |
scroll | number | Scroll depth percentage | 75 (75% scrolled) |
exit | number | Exit intent detection | 2 (2 seconds) |
click | string | Element interaction | 'submit-button' |
event | string | Custom app event | 'checkout_complete' |