The community chat widget is a customizable chat window for your website that enables real-time communication among users. With features like private messaging and moderation tools, it enhances engagement and fosters a positive community atmosphere.
Implement the community chat widget
- To make the chat appear on your site, you need to integrate the following script on your site to load the community chat widget :
< script type = 'text/javascript' >
window.toky_customVars = {
productId: 'PRODUCT_ID_HERE'
};
(function () {
var toky = document.createElement('script');
toky.type = 'text/javascript';
toky.async = true;
toky.src = 'https://community.mywebsite.com/webview/embed.js';
(document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]).appendChild(toky);
})();
</script> - Then, replace [community.mywebsite.com] with the subdomain chosen for your community platform
👉 The productId variable is optional. It is used to display the product concerned by the question on the community platform so that members can consult it. - The productId variable must have a value for product pages
On pages other than products, you can :Delete : window.toky_customVars = { productId:'PRODUCT_ID_HERE' }
Or replace it with : window.toky_customVars = {} ; - Copy the code to the place where you want to install the module on your site:
If you want the TokyWoky chat on all pages: on the template/layout of the site ⇒ Which we strongly recommend.
If you want the TokyWoky chat on specific pages: before the body of each page
Open chat functions (optional)
These functions allow you to open the chat from a button to arrive on a specific tab.
- To open the chat directly the Ask tab you have to call the following function: toky.widget.openQuestions()
- To open the chat directly the Answer tab you have to call the following function: toky.widget.openAnswers()
- To open the chat directly the Inbox tab, call the following function: toky.widget.openInbox()