Add voice responses to your QuestionPro surveys with a single Pre JavaScript Logic block. Requires a QuestionPro Research or Team edition, which is where JavaScript Logic lives.
AvailableIn the survey editor go to Logic > JavaScript Logic > Pre JS and paste this block. Replace proj_XXXXXXXX with your project key from the dashboard, and set data-lang to the language your fieldwork is in. The code loads the widget, finds the open-ended answer field on the page, inserts the microphone directly above it and initialises it — there is no second snippet and nothing to add to the question text.
window.__VC_PRELOADED=true; try {
var ta = document.querySelector('textarea.form-input:not(.hidden-text)');
if (ta && !document.getElementById('gv-container')) {
var wrap = document.createElement('div');
wrap.id = 'gv-container';
wrap.setAttribute('data-project','proj_XXXXXXXX');
wrap.setAttribute('data-target','textarea[id="'+ta.id+'"]');
wrap.setAttribute('data-lang','es');
// Optional: wire a QuestionPro merge field here so recordings join back
// to the survey response, e.g. wrap.setAttribute('data-session','${...}');
ta.parentNode.insertBefore(wrap, ta);
if (!document.getElementById('gv-script')) {
var s = document.createElement('script');
s.id = 'gv-script';
s.src = 'https://api.voicecapture.ai/voice.js';
s.onload = function(){ try { if (window.GeniusVoice && GeniusVoice.init) GeniusVoice.init(wrap); } catch(e){} };
document.body.appendChild(s);
}
}
} catch(e) {}The code targets the open-ended answer field on the page and inserts the widget immediately above it. That is deliberate — it means you do not edit the question text and the integration survives a question being re-worded. It also means a page with two open ends is ambiguous, so keep one voice-enabled open end per page.
Open the survey test link, record ten or fifteen seconds and watch the Voice Capture dashboard. The transcript should land within about half a minute. If nothing arrives, check the project key first, then confirm the block really is in the Pre JS slot — the code is written to run there, before the answer field is interacted with.
Publish as usual. Recordings upload and transcribe during fieldwork, so the open end is readable while the study is still live. Export to CSV on any plan, or to Excel on a paid credit pack.
A single microphone button appears immediately above the open-ended text field. Recording uses the browser’s own audio API, so respondents install nothing and see only the standard microphone permission prompt.
They can record, play the answer back and re-record before moving on. If the browser refuses microphone access, the widget simply never mounts and QuestionPro’s own text field is left untouched — nobody is prevented from answering because voice was unavailable to them.
Phones behave identically. That is where the difference shows up most: a respondent who would have typed three words into a phone keyboard will happily talk for twenty seconds.
Audio uploads as soon as the respondent stops and is transcribed automatically. Audio files are not kept, only the resulting text, and everything travels over an encrypted connection.
Each recording carries your project key and the identifier of the answer field it was attached to. What it does not carry by default is a QuestionPro response identifier: unlike Alchemer’s merge code, the block has no session value handed to it, so the join key is left empty unless you supply one. If you need transcripts matched row by row to QuestionPro responses, wire a QuestionPro merge field into the data-session attribute in the block before you go to field. This is the single most common thing teams discover too late.
Everything is readable in the dashboard as it arrives and exports to CSV, or to Excel on a paid credit pack. Spoken answers to the same question run longer than typed ones — 6× in our pre-product pilot testing, about twice as many words in client fieldwork since — and how we measured that publishes both in full.
The block found no open-ended answer field on the page. Either the page has no open end, or the open end is hidden by display logic until another question is answered, in which case there was nothing to attach to at the moment the code ran. Put the voice-enabled open end on its own page, visible from the start.
Check the project key first — it is the data-project value in the block, and a truncated paste fails silently. If the key is right, confirm the survey is on a Research or Team edition: JavaScript Logic is simply not executed on editions that do not include it, so the block looks correct in the editor and never runs.
There is no automatic join on QuestionPro. Add a QuestionPro merge field to the data-session attribute in the block before fieldwork, as described above. Matching on timestamp afterwards is possible for a handful of interviews and thoroughly unpleasant for a real sample.
Each credit pack caps recording length: 90 seconds on the Free Trial, 180 on Essential, 300 on Professional. Respondents hitting the ceiling regularly is usually a sign the question is doing the work of two.
A longer guide to the same setup: what to check on your edition, how to word an open end for speaking rather than typing, and how to get the transcripts into your tabulation.
How to add voice responses to your QuestionPro 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 FreeWe use cookies to improve your experience and analyze site traffic. Learn more