Modal vs. inline
Modal (versive.open) overlays the study on your page — best for triggered feedback moments (after checkout, on cancel, feature launch). Only one modal session is active at a time; opening a new one closes the previous.
Inline (versive.embed) renders the study inside a container element — best for dedicated feedback pages or embedded research panels. The iframe auto-resizes to the study content as the participant progresses, and multiple inline embeds can coexist on one page.
Zero-code embedding with data attributes
When loaded via the script tag, the SDK automatically scans the page (and keeps watching for dynamically added elements, so single-page apps work) and wires up any element withdata-versive-study:
Passing context (identifying participants)
Usecontext to attach your own data — a user ID, plan, experiment arm — to the response. Context arrives in Versive as response metadata, available in results, filters, and exports:
Matching your app’s colors
A study uses the colors set on its Branding tab. To match your product, pass your own palette for the embed withcolors (or the data-versive-*-color attributes). Each color you pass replaces the study’s for this embed only; a color you leave out keeps the study’s.
If your app has its own light/dark switch, pass the active palette each time you open a study:
Preview mode
Setpreview: true (globally in init, per call, or via data-versive-preview) to run the study without saving responses — for development and internal demos:
Reacting to the study lifecycle
Listen for events on the session (or set defaults ininit) — for example, to grant an incentive on completion: