Getting Started

    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.

    ·2 min read

    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

    1. Tag your hero selectors with data-nds-context.
    2. The Rep scans the page, builds a context object, and calls compose-brief to draft a first-person message in the visitor's voice.
    3. When the visitor sends, guided-search returns 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.