It's possible to collect feedback with any custom element on your website or inside your web app.
This way, you can submit feedback to your Survicate surveys without showing the survey to visitors.
This feature works for the following question types: Text answer, Single-answer selection, Rating scale, Numerical scale, Smiley scale, and NPSยฎ questions.
The method requires some coding, and we prepared detailed instructions for developers here. In this article, we'll describe the whole process and will refer to the Developer's Documentation.
๐ Keep reading to learn how to set it up.
Step 1. Create a Website or in-product survey
To start, let's create a Website or in-product survey in your Survicate workspace.
You can use a ready-to-use survey template, upload questions, use AI assistance, or add questions manually.
Check out how to create a Website survey here.
Step 2. Set up your survey's frequency
After creating your survey, go to its Target โก๏ธ Frequency tab. Here, it's important to allow survey retaking.
Please enable this setup:
Step 3. Hide the survey from the UI
Since the survey will be used to submit feedback without showing the questionnaire to visitors, it should be hidden from the user interface, but remain accessible via the API.
Find a survey's ID in the address bar when the survey is opened in your Survicate account:
Once you have the survey's ID, you will need to pass it to the Survicate tracking code using the hiddenSurveys
property.
Check how to add it to your code for your installation method here.
Step 4. Retrieve survey points metadata
Before submitting an answer, you need to know the available questions (points) and possible answers for a given survey. Use the getSurveyPointsMetadata
method:
const points = _sva.getSurveyPointsMetadata('surveyId');
It will return an array of objects, each describing a survey point (question) and its possible answers:
interface SurveyPointInfo {
pointId: number;
answerType: 'text' | 'rating' | 'single_choice' | 'nps' | 'csat', 'numerical';
answers?: Array<{ id: number }>;
}
where:
pointId
: The unique ID of the question.answerType
: The type of answer expected (e.g., text, rating, single choice).answers
: Optional, an array of possible answer IDs (for choice-based questions).
Now, you can use the surveyId
, pointId
and answerId
to submit the answer
.
Step 5. Submit an answer
Use the submitAnswer
method to send a response:
interface SubmitAnswerParams {
surveyId: string;
pointId: number;
answerId?: number; // Required for choice-based questions
answer?: string | number; // Required for Text or NPS questions
}
For example, if you'd like to submit an open-text answer, here's how your code could look:
_sva.submitAnswer({
surveyId: "12345abcdef54321",
pointId: 1111111,
answer: "This is a test answer"
});
All answers submitted via this method will be visible in the survey's Analyze tab in your Survicate workspace!
Handling errors and best practices
Check the browser's Console for informative console warnings during development and debugging.
You can check out possible error messages, and best practice tips, here.
๐ If you have any questions - feel free to reach out to our team via chat or e-mail: support@survicate.com.
Net Promoter, NPS, and the NPS - related emoticons are registered U.S. trademarks, and Net Promoter Score and Net Promoter System are service marks, of Bain & Company, Inc., Satmetrix Systems, Inc. and Fred Reichheld.