Personalize the Rep from your hero selectors
Use data-nds-context attributes (or window.NDS.setContext) to pre-fill the Answer Engine with a personalized brief based on the visitor's selections.
The Answer Engine can now read selector state from your hero section and auto-draft a personalized message for the visitor. When the brief is thin, it asks 1–2 short follow-up questions before sending the lead.
How it works
- Tag your hero selectors with
data-nds-context. - The Rep scans the page, builds a context object, and calls
compose-briefto draft a first-person message in the visitor's voice. - When the visitor sends,
guided-searchreturns both a short answer and captures the lead — with any missing qualifiers (timeline, budget, role, team_size, use_case) collected via inline follow-ups.
Declarative setup (no JS)
<button data-nds-context="service" data-nds-value="Campaign page"
aria-pressed="true">Campaign page</button>
<input type="radio" name="persona"
data-nds-context="persona" data-nds-value="Demand Gen" checked>
<div data-nds-context="budget" data-nds-value="$5k"></div>
<div data-nds-context="timeline" data-nds-value="2–3 weeks"></div>
An element is treated as "selected" when any of these is true: aria-pressed="true", aria-selected="true", data-nds-selected, a class containing active/selected/is-active/is-selected, <input type="checkbox|radio"> checked, <option> selected, or non-form elements (always live).
Imperative API
<script src="https://nextdaysales.com/widget/nds-context.v1.js" defer></script>
<script>
window.addEventListener("load", () => {
window.NDS.setContext({
service: "Campaign page", persona: "Demand Gen",
budget: "$5k", timeline: "2–3 weeks",
});
});
</script>
The Rep watches for changes and re-drafts the message automatically.
Supported keys
Any short key works, but these light up follow-up question logic on the server: service, persona, role, budget, timeline, team_size, use_case.
Plan availability
- Starter — template-based draft (no AI rewrite), no follow-up questions.
- Growth and up — AI-drafted briefs and inline qualification.
Privacy
Context lives only in Rep memory for the current page load. No cookies, no localStorage, no persistent identifiers.
Related Articles
Getting Started with Next Day Sales
Connect your first site, crawl it, and launch the Answer Engine Rep in under 10 minutes.
Getting help inside the app
Ask the support assistant, track your conversations, and reach a human when you need one.
Setting Up Your Workspace
A quick guide to configuring your workspace — name, branding, and team invites.