Setting Up Dynamic Context Ingestion
Last updated: July 22, 2026
Configure Dynamic Context Ingestion when your website should pass known visitor information to a Marketing Agent before a conversation starts.
Before You Begin
Create the Marketing Agent.
Install the Docket widget script on the website where you will send context.
Identify the smallest set of visitor fields the agent needs.
Decide how the agent should use each field.
Open Dynamic Context Ingestion
Open Marketing Agent Configuration.
Select the agent.
Open the Agent tab.
Expand Dynamic Context Ingestion.
Turn on the Dynamic Context Ingestion switch.

Add a Variable

Select Add Variable.
Enter the key your website will send, such as
company_name.Add a description explaining what the value means and how the agent should use it.
Save the variable.
Keep variable names stable and match them exactly in your website code. Use clear descriptions such as: "This is the visitor's company. Use it to make examples relevant, but do not repeat it unnecessarily."
Pass Context from Your Website
Call setContext() before the conversation starts and inspect the returned result.
const result = await window.AISeller.setContext({
name: "Jordan",
company_name: "Northstar Labs",
isCustomer: true
});
if (result.success) {
window.AISeller.showAndConnect();
} else {
console.warn(result.message);
}Values must be strings, numbers, booleans, or null. Nested objects, arrays, files, functions, dates, and undefined values are rejected.
Reset Context
Call resetContext() when the visitor logs out, changes identity, or when stored context is no longer valid.
const result = await window.AISeller.resetContext();Resetting prepares an empty context object for the next conversation. It does not change a conversation already in progress.
Verify the Setup
Open the deployed experience in a private browser window.
Call
setContext()with documentation-only values.Confirm the returned
successvalue istrue.Start a new conversation.
Ask a question that should use one configured variable.
Confirm the agent uses the value according to its description.
Reset context and confirm the next conversation does not reuse the previous values.
Troubleshooting
Problem | What to check |
|---|---|
A variable is ignored | Confirm the JavaScript key exactly matches the variable configured in Docket. |
| Read |
Context appears one conversation late | Call |
Old visitor data appears | Call |
| Confirm the Docket widget script loaded before your code runs. |