Visitor Element Selection
What the Visitor Experiences
A visitor can select a button, field, card, or another element on your website through the widget and send a question about that exact element. Its name and markup are sent with the question, so the AI assistant can explain the element, find a linked instruction, highlight it, scroll to it, or perform a permitted action.
Enable Element Selection
5. In channel settings, enable Page element selection and save the changes. Alternatively, pass features: { element_selection: true } in init on the site. The explicit init value takes priority. The change applies on the next widget initialization.

How a Visitor Selects an Element
- The visitor opens the Context menu in the widget input area and clicks Selection.
- Selection mode starts on the page and highlights the available element under the pointer.
- The visitor clicks the required element. Its normal action is not performed at this point.
- The selected element appears in the Context menu. The information icon opens its details; the cross removes it before sending the question.
- After a successful send, the selected element is attached only to that message and is cleared. After an error, it remains in the draft so the visitor can retry.
The Escape key cancels selection mode. The website sends current page context separately through the Widget Public API; a selected element does not replace it.
Check the Transmitted Data
Selected-element context contains only information extracted by the widget from the page:
- page URL and title;
- visible text or
data-ai-label; - page area and section;
- element type, HTML role, and declared action meaning;
- stable
data-ai-context-id; data-ai-kb-querysearch hint;- business entity type and ID for repeated cards or rows.
For repeated elements, provide data-ai-entity-type and data-ai-entity-id as a pair. The agent can then distinguish a specific product, order, or list row. If several elements have the same context key and cannot be distinguished, no automatic action is performed.
Technically, the data is grouped into element (label, role, tag, kind, action, and visible text), place (URL, title, area, and section), ref (context key, document reference, search phrase, and entity), and state (disabled, selected, and invalid flags). The loader does not read a field's JavaScript value property and does not send an entered password. However, visible text and data-ai-*, aria-*, title, and placeholder values used to describe the element may be included in context, so do not put secrets in them.
Page and business-object context is supplied separately. Selecting a button does not by itself add a lead, order, or project ID to selected-element context. System lead fields may still be available to the agent from the lead profile; add site data through widget context or markup for the specific entity.
Prepare the Website
Use markup examples for stable targets and hidden menus, then link elements to documentation. If the visitor requests an action rather than an explanation, check supported actions and their results.