Newer Version Available
Deployment API Code Sample
Chat Window
- startChat
- showWhenOnline
- showWhenOffline
- addCustomDetail
- setName
- map
- setChatWindowWidth
- setChatWindowHeight
- doKnowledgeSearch
The name of the customer (Jane Doe for this example) appears in the Console from setName (1). When you call addCustomDetail.doKnowledgeSearch, the search automatically appears in the Knowledge widget (2).
Optional Cookies
You can use your consent manager to provide users the ability to opt in or opt out of optional cookies. If they choose to opt in you can pass true to the fourth parameter in liveagent.init() to enable tracking optional cookies. Otherwise, if they choose to opt out, pass false. Omitting the fourth parameter is the same as passing true.
If the user opts out, you can also call liveagent.disableOptionalCookies(). This deletes and stops tracking the optional cookies. This is the same as passing false to liveagent.init() except that it takes higher order of precedence than liveagent.init() with the value true. For example, if you call liveagent.disableOptionalCookies() first and then pass true to liveagent.init(), optional cookies are still disabled. Unlike liveagent.init(), liveagent.disableOptionalCookies() can also be called anytime after the page is loaded.
If the user opts back in to optional cookies after opting out, pass true to liveagent.init() on the next page load.