Respondent context
Hand the conversation the visitor's email and what your page already knows about them, so the agent confirms those details in one sentence instead of asking, with the limits and the trust rules that apply.
When your page already knows who the visitor is, pass it along. The agent then confirms what it knows in one short sentence instead of asking for it again, and moves on to what it does not know.
Passing email and context
Two options, on the script tag, on the element, or through the JavaScript API:
<script
async
src="https://ask.betterfeedback.ai/widget.js"
data-survey="YOUR_SURVEY_ID"
data-target="#contact-form"
data-auto-height
data-voice="false"
data-email="jane@acme.com"
data-context='{"company":"Acme","plan":"free","seats_in_use":"3"}'
></script>betterfeedback("config", { email: "jane@acme.com", context: { company: "Acme", plan: "free" } });Set both before the visitor presses Start: they travel with the request that starts the session.
context merges key by key across calls, so a later config can add a key without repeating
the rest.
On a plain link
Off by default. A link can be written by anyone and sent to someone else, so a survey reads these parameters only after you switch on "Accept email and context from the link" in its Share tab. With that on, and without a page to run the script on (a button, an email, a redirect from your own form), put the same two values in the link's query string:
https://ask.betterfeedback.ai/s/YOUR_SURVEY_ID?email=jane%40acme.com&context=%7B%22company%22%3A%22Acme%22%2C%22plan%22%3A%22free%22%7Dcontext is the same flat JSON object, URL-encoded:
const link = new URL("https://ask.betterfeedback.ai/s/YOUR_SURVEY_ID");
link.searchParams.set("email", "jane@acme.com");
link.searchParams.set("context", JSON.stringify({ company: "Acme", plan: "free" }));The limits below apply. A value that does not parse is ignored and the conversation opens as usual. Inside the script embed the query string is not read, and when a plain link is framed by a page that also passes values, the page's values win key by key.
A query string is visible to the respondent, kept in browser history and written to server logs. Use it for what you would put in a link anyway (plan, company, team size), never for secrets, and prefer the script embed on pages that can run it.
Limits
| Limit | |
|---|---|
email | One address of at most 254 characters, with one @ and a dotted domain. Anything else is dropped |
context keys | At most 24, each 1 to 40 characters from A-Z a-z 0-9 _ . - |
context values | Strings of at most 500 characters. Numbers and booleans are written as text; nested objects and arrays are dropped |
context total | 4 KB of keys and values together. Entries beyond the cap are dropped, never truncated mid-value |
What the agent does with it
The agent receives the details as unverified information from the host page. When a question in the survey asks for something the context already holds, the agent asks the visitor to confirm it in one sentence and records the confirmed value. If the visitor corrects it, their words are recorded instead. The agent never states a detail as a fact before the visitor confirms it, never reads the list out, and never mentions where it came from.
Trust
Anything your page sets, a visitor can change in their browser's developer tools. Treat both values as hints that save the visitor typing, not as identity: re-check anything that matters on your own side.
Email and context are session data. They are never stored on the survey, never part of a survey's
stored appearance, and never read from a ?c= link. They come from the script tag, the element,
the JavaScript API, or, for a survey that switched it on, the two query parameters of a plain
link described above.
How it reaches the agent
The conversation page posts { surveyId, email, context } to its start endpoint, which checks
the limits above again and puts { "v": 1, "source": "host", "email": …, "context": … } into
the metadata of the agent's job for that session. Nothing personal is sent in a URL.
JavaScript API
The betterfeedback() command vocabulary for opening, configuring and mounting the embed, the events it dispatches on the element and document, the queue stub for calls made before the script loads, and the message shape a plain iframe receives.
FAQ
Answers to the questions that come up around the embed, from Content-Security-Policy and microphone prompts to the "Powered by" footer, redirects on completion and running two widgets on one page.