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 with data-versive-study:
Passing context (identifying participants)
Use context 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:
Context values are appended to the study URL as query parameters, so they’re visible to the participant. Never pass emails, names, tokens, or anything sensitive — use an opaque internal ID and join it to your data on your side. The keys embed and mode are reserved and ignored.
Preview mode
Set preview: 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 in init) — for example, to grant an incentive on completion:
The full event list is in the API reference.