Widget configuration
The PageClerk widget is configured by a single global object, window.pageclerkConfig, that you define before loading the widget script.
<script> window.pageclerkConfig = { chatbotId: "YOUR_CHATBOT_ID" };</script><script src="https://pageclerk.com/api/widget.js" defer></script>chatbotId
Section titled “chatbotId”Type: string · Required
The 32-character ID of the chatbot to load. Find it in your dashboard under Chatbots → Settings or on the Embed & Share tab.
If chatbotId is missing, the widget logs an error and does not render:
PageClerk: pageclerkConfig object or chatbotId not definedWhat is configured elsewhere
Section titled “What is configured elsewhere”Everything that is not chatbotId — appearance, greeting, avatar, and allowed domains — is managed in the dashboard and fetched by the widget at load time:
- Appearance — launcher colors, avatar, and greeting.
- Allowed domains — restrict where the widget may load.
Because of this, dashboard changes apply to every embedded site immediately, with no embed-code edits.
Loading order
Section titled “Loading order”window.pageclerkConfig must be assigned before widget.js executes. Loading the script with defer in the same document satisfies this as long as the inline config script appears first.