Dynamic Context Variable Reference

Last updated: July 22, 2026

Dynamic Context variables define which visitor fields a Marketing Agent can use and what each value means during a conversation.

Where Variables Are Configured

Open Marketing Agent Configuration, select the agent, open the Agent tab, and expand Dynamic Context Ingestion.

Configured variables table in the real captured empty state

Each variable has two parts:

Field

Purpose

Variable

The exact key sent through setContext() or after the ctx_ URL prefix.

Description

The instruction explaining what the value means and how the agent should use it.

Supported Values

The JavaScript API accepts these flat values:

Type

Example

String

plan: "Enterprise"

Number

employeeCount: 500

Boolean

isCustomer: true

Null

renewalDate: null

Nested objects, arrays, files, functions, dates, and undefined values are rejected.

URL parameters are always ingested as strings. For example, ctx_employeeCount=500 produces the string value "500".

Naming Guidelines

Add Variable control in the real Dynamic Context Ingestion panel
  • Match names exactly between Docket and your website code.

  • Treat capitalization as significant.

  • Use stable names such as name, company_name, plan, or is_customer.

  • Avoid spaces and punctuation that complicate JavaScript and URL usage.

  • Do not encode secrets or sensitive details in a variable name.

  • Do not rename a production variable without updating every website implementation that sends it.

Description Guidelines

A useful description identifies the value and limits how the agent should use it.

Variable

Recommended description

name

This is the visitor's first name. Use it for a natural greeting, but do not repeat it unnecessarily.

company_name

This is the visitor's company. Use it to make examples relevant to their organization.

plan

This is the visitor's current plan. Use it only when answering plan-specific questions.

is_customer

This indicates whether the visitor is an existing customer. Do not ask them to qualify as a new prospect when the value is true.

region

This is the visitor's operating region. Use it when regional availability or routing is relevant.

Avoid descriptions such as "company" or "use this value." They do not tell the agent when or how to apply the field.

JavaScript and URL Mapping

await window.AISeller.setContext({
  company_name: "Northstar Labs",
  plan: "Enterprise",
  is_customer: true
});

The equivalent URL keys use the ctx_ prefix:

?ctx_company_name=Northstar%20Labs&ctx_plan=Enterprise&ctx_is_customer=true

The prefix is removed before the key is matched. URL values remain strings, so ctx_is_customer=true is the string "true", not a boolean.

Verify a Variable

  1. Set a documentation-only value before starting a conversation.

  2. Confirm setContext() returns success: true.

  3. Start a new conversation.

  4. Ask a question that should use the field.

  5. Confirm the agent follows the variable description without exposing unrelated context.

Related Articles