In-app surveys ask your users a short question inside your app and show each answer next to the session replay it came from, so you see why users feel the way they do, in their own words.
showSurvey.In-app surveys need vexo-analytics 1.16.0 or later. They aren't available for websites.
Render <VexoSurveys /> once, as the last child of your root layout, so a survey can cover your screens:
import { VexoSurveys } from 'vexo-analytics';
export default function RootLayout() {
return (
<>
<Stack />
<VexoSurveys />
</>
);
}
The SDK fetches the surveys a device can see only while <VexoSurveys /> is mounted, so apps that don't render it send no extra requests. A survey shows as a sheet at the bottom of the screen. The SDK shows at most one survey per session.
To show a survey at a moment that you choose, give it the Only from code (showSurvey) trigger and call showSurvey with the survey's ID, which is the last part of its URL in the dashboard:
import { showSurvey } from 'vexo-analytics';
const shown = showSurvey('SURVEY_ID');
showSurvey returns false if Vexo didn't deliver that survey to this device (it isn't running, or the person isn't in its audience, or they already answered it) or if another survey is on screen.
You can stop a running survey and resume it later. You can change a survey's name, trigger, and audience at any time, but its questions are fixed once you launch it, so every answer keeps meaning what its question said. To ask something else, create a new survey.
Vexo decides on its servers, each time the app starts or returns to the foreground. A device gets a running survey only if all of these are true:
identifyDevice.Click a survey in Surveys to see its results over the survey's whole life:
A person who closes the survey after answering some questions counts as a response with those answers. A person who closes it before answering counts as dismissed. Dismissals aren't responses, and they aren't billed.
VexoMask, so its answers are masked in session replays once masking is available in the SDK's recording engine. Until then, replays are protected by the replay blur setting, as for every other input in your app.requireConsent, the SDK fetches and sends nothing before grantConsent(). After disableTracking(), it fetches no surveys and sends no answers.Every account gets 1,500 answered survey responses each billing period for free, across all its apps. Without billing, your surveys pause when you reach 1,500 and start again the next billing period; responses to surveys already on screen are still saved. With billing, surveys keep running, and responses past 1,500 in a billing period cost $0.03 each. Your survey usage for the current period shows on the Surveys page.