Add voice responses to open-ended questions in Toluna Start with one script per question. The respondent speaks, the transcript is written into the question's own answer box, and Toluna stores it and shows it in Analyze like any typed answer.
AvailableIn the Toluna Start survey editor, open the open-ended question, click ADD SCRIPT and choose the "After question render" moment. Paste the block from your Voice Capture dashboard and save. It is plain JavaScript, so paste it as it is, without <script> tags around it: Toluna runs this box as code, and a tag makes it fail. Do not paste it into the question text either, because the text editor removes scripts. In the QCODE line, write the question's code in Toluna (q1, q2 and so on). For voice on several questions, paste the same block on each one and change only QCODE.
// Voice Capture — paste into the question: ADD SCRIPT > After question render
(function () {
try {
var PROJECT_KEY = 'proj_XXXXXXXX';
var QCODE = 'q1'; // the question's precode in Toluna (q1, q2, ...)
var RESPONDENT_ID = '';
var q = document.querySelector('[data-precode="' + QCODE + '"]');
if (!q || q.querySelector('[data-gv-host]')) return;
var field = q.querySelector('textarea') || q.querySelector('input[type="text"]');
if (!field) { console.warn('[VoiceCapture] no text box in', QCODE); return; }
if (!field.id) field.id = 'gv-field-' + QCODE;
var sessionId = RESPONDENT_ID;
try { sessionId = sessionId || new URLSearchParams(location.search).get('gid'); } catch (e) {}
try { sessionId = sessionId || (window.RuntimeGlobals && window.RuntimeGlobals.respondentGid); } catch (e) {}
if (!sessionId) {
try { sessionId = window.sessionStorage.getItem('gv_sid_proj_XXXXXXXX'); } catch (e) {}
if (!sessionId) {
sessionId = 'tl_' + Date.now() + '_' + Math.random().toString(36).slice(2, 10);
try { window.sessionStorage.setItem('gv_sid_proj_XXXXXXXX', sessionId); } catch (e) {}
}
}
sessionId = String(sessionId);
var host = document.createElement('div');
host.setAttribute('data-gv-host', QCODE);
host.setAttribute('data-project', PROJECT_KEY);
host.setAttribute('data-target', '#' + field.id);
host.setAttribute('data-session', sessionId);
host.setAttribute('data-question', QCODE);
host.setAttribute('data-lang', 'es');
field.parentNode.insertBefore(host, field);
var initHost = function () { try { window.GeniusVoice.init(host); } catch (e) { console.warn('[VoiceCapture]', e); } };
var loader = document.getElementById('gv-lib');
if (window.GeniusVoice && window.GeniusVoice.init) {
initHost();
} else if (loader) {
loader.addEventListener('load', initHost);
} else {
var s = document.createElement('script');
s.id = 'gv-lib';
s.src = 'https://api.voicecapture.ai/voice.js';
s.onload = initHost;
document.body.appendChild(s);
}
} catch (e) {
console.warn('[VoiceCapture]', e);
}
})();Toluna runs question scripts in Preview and in the test link, so you can check everything before launching. Open the test link, wait for the voice question and check that the microphone button appears above the answer box. Record a few seconds, let the transcript appear in the box, then move on and finish the survey. You can add ?gid=TEST01 to the end of the test link to give your test respondent a recognisable key in Voice Capture.
This is the check that decides whether the setup works. After finishing a test response, open Analyze in Toluna Start and look at the voice question: the transcript should be listed among its answers, exactly as it appeared in the box. If the respondent edited the text before moving on, Toluna keeps the edited version, which is the one they submitted. If it is there, the integration is doing its job.
Launch the survey to your audience as you normally would. Because the transcript is the answer, Toluna treats it as one: we have confirmed it in Analyze, next to the respondent's other answers. Toluna's exports and AI insights read the same answer field, but we have not tested each of them yet. The Voice Capture dashboard keeps its own copy of every response, with whether it was spoken or typed, how long the recording was and the question code, which is what you need to compare spoken and typed answers.
The script tags every response with a respondent key, so all the answers one person gives across your voice questions stay together in Voice Capture. It takes the key from the gid parameter of the survey link, which is the respondent id Toluna also sends in its Complete, Screen out and Quota full redirects. If the link carries no gid, it uses Toluna's own respondent id for the session, and failing that a key that lasts for the whole survey in that browser tab.
Check that the script is under ADD SCRIPT with the "After question render" moment, not in the question text, and that it has no <script> tags around it. Then check that QCODE matches the question's code in Toluna exactly. The browser console shows a [VoiceCapture] message when the question or its answer box cannot be found.
Toluna runs the ADD SCRIPT box as plain JavaScript. A SyntaxError such as "Unexpected token '<'" means HTML was pasted, usually a <script> tag. Copy the block again from the Voice Capture dashboard and paste it without changes.
Make sure the respondent moved on from the question and finished the survey, because Toluna saves an answer when the page is submitted. Then check that the script is on the same question you are reading in Analyze: with several voice questions, each block needs its own QCODE.
We have tested it with surveys sent to your own audience through the test link. The script runs in the survey page itself, which is the same for every audience, but we have not yet fielded a study to the Toluna panel. If that is your plan, write to us before you launch.
A longer guide to the same setup: where voice fits next to QProbe, the three details that decide whether the script works, and the check in Analyze that confirms the transcript arrived.
How to add voice responses to Toluna Start surveysOur AI assistant can walk you through the setup step by step.
Set up Voice Capture in under 5 minutes. No credit card. No commitment.
Get Started Free