Cookie Consent and Anonymous Proactive Triggers
Website consent and the widget are separate
Your website remains responsible for its own consent banner and privacy notice. The widget consent interface does not replace your consent-management platform (CMP), and WebChatAgent does not add a second banner inside the embedded widget.
The widget starts in anonymous Privacy Mode when tracking-consent is omitted or set to unknown. In this mode, local trigger decisions stay in memory and are not sent to WebChatAgent.
<!-- tracking-consent is optional; omitted means unknown -->
<web-chat-agent chatbot-id="YOUR_ID"></web-chat-agent>
What works without a consent signal
| Feature | Without a consent signal |
|---|---|
| Time on page | Works locally in memory |
| Scroll depth | Works locally in memory |
| Exit intent | Works locally in memory |
| Inactivity | Works locally in memory |
| URL match | Works for the current page |
| Section visibility | Works locally in memory |
| Rage click | Works locally in memory |
| Pages visited | Works during same-document SPA navigation; resets after a full reload |
| Returning visitor | Disabled |
| AI-generated proactive greeting | Uses the configured static fallback |
| Trigger analytics before chat interaction | Disabled |
| Persistent/daily cooldown | Falls back to the current document lifetime |
| Permanent dismiss | Lasts only until the document is reloaded |
Before a visitor interacts with the chat, anonymous trigger evaluation does not create a visitor ID, write proactive state to browser storage, or send behavioral events to WebChatAgent.
Consent interface
Use the optional attribute when your consent manager already knows the visitor's choice:
<web-chat-agent
chatbot-id="YOUR_ID"
tracking-consent="granted"
></web-chat-agent>
Allowed values are unknown, denied, and granted. Missing and invalid values are treated as unknown.
For consent changes without a page reload, dispatch:
window.dispatchEvent(
new CustomEvent('webchatagent:consent', {
detail: { tracking: 'granted' }
})
)
Send denied when consent is rejected or revoked. WebChatAgent then stops optional tracking and removes proactive-trigger state plus consent-gated UI personalization. Functional chat-session storage remains available after the visitor actively uses the chat.
granted after your CMP has recorded a valid choice for the category that covers every feature you enabled. AI-generated greetings, visitor recognition and trigger analytics may require different descriptions or categories in your setup. Confirm the mapping with your privacy adviser.Generic CMP adapter
function updateWebChatAgentConsent(isGranted) {
window.dispatchEvent(
new CustomEvent('webchatagent:consent', {
detail: { tracking: isGranted ? 'granted' : 'denied' }
})
)
}
// Call this from your CMP's consent-ready and consent-change callbacks.
updateWebChatAgentConsent(false)
Cookiebot
Cookiebot exposes the current category decisions through Cookiebot.consent and announces changes with browser events. Choose the category that matches your documented purposes:
function syncWebChatAgentWithCookiebot() {
const consent = window.Cookiebot?.consent
const granted = Boolean(consent?.preferences && consent?.statistics)
updateWebChatAgentConsent(granted)
}
window.addEventListener('CookiebotOnConsentReady', syncWebChatAgentWithCookiebot)
window.addEventListener('CookiebotOnAccept', syncWebChatAgentWithCookiebot)
window.addEventListener('CookiebotOnDecline', syncWebChatAgentWithCookiebot)
See the Cookiebot developer reference for its current category properties and events.
Complianz
Complianz provides cmplz_has_consent(category) and status/revoke hooks:
function syncWebChatAgentWithComplianz() {
const granted = typeof window.cmplz_has_consent === 'function'
&& window.cmplz_has_consent('marketing')
updateWebChatAgentConsent(granted)
}
jQuery(document).on(
'cmplz_status_change cmplz_revoke cmplz_enable_category',
syncWebChatAgentWithComplianz
)
Replace marketing if your documented CMP configuration uses another category. See the Complianz integration reference.
Borlabs Cookie 3
Create a WebChatAgent service in the appropriate Borlabs service group and use that group's ID:
function syncWebChatAgentWithBorlabs() {
const granted = Boolean(
window.BorlabsCookie?.Consents?.hasConsentForServiceGroup('marketing')
)
updateWebChatAgentConsent(granted)
}
window.addEventListener('borlabs-cookie-after-init', syncWebChatAgentWithBorlabs)
window.addEventListener('borlabs-cookie-consent-saved', syncWebChatAgentWithBorlabs)
Replace marketing with the service-group ID used in your Borlabs configuration. See the Borlabs Cookie JavaScript API.
Browser storage reference
| Key | Storage | Created when | Purpose |
|---|---|---|---|
chatSessionId_<chatbotId> | localStorage | Visitor actively uses chat | Resume the functional conversation |
chatRecentSessions_<chatbotId> | localStorage | Visitor uses recent-chat features | Local list of known chat sessions |
chatEndedSessions_<chatbotId> | localStorage | Visitor ends a chat | Keep ended sessions out of the active view |
chatWidgetIsOpen | localStorage | Visitor opens or closes the floating widget | Restore functional UI state |
livechat_timeout_<chatbotId>_<sessionId> | localStorage | Visitor requests live chat | Resume the live-chat timeout |
chatThumbRatings_<chatbotId> | localStorage | Tracking consent is granted and feedback is submitted | Remember local feedback selection |
wca_privacy_box_dismissed_<chatbotId> | sessionStorage | Tracking consent is granted and notice is dismissed | Hide the notice in the current tab |
wca_speech_bubble_dismissed_<chatbotId> | sessionStorage | Tracking consent is granted and bubble is dismissed | Hide the bubble in the current tab |
wca_triggers_<chatbotId>_* | localStorage/sessionStorage | Tracking consent is granted | Returning visits, counters, cooldowns and dismiss state |
Your privacy notice should describe the storage and server-side processing actually enabled in your configuration. This documentation is technical guidance, not a substitute for legal advice.
