Installation
Embed the TWT Chat widget on every page of your website.
Install
Copy and paste the following snippet before the closing </body> tag on each page:
<!-- Start of TWT Chat code -->
<script>
window.__twt__config = {
appid: 'YOUR_APP_ID',
lang: 'zh-cn',
theme: 'light',
sbs: '',
sbs_mm: '',
ranstr: '',
name: '',
nickname: '',
email: '',
phone: '',
icon: '1'
};
(function (n, t) {
var e = {
init: function () {
var n = t.createElement('script');
n.async = !0;
n.type = 'text/javascript';
n.src = 'https://visitorchat.twt.com/install/core.js?version=v1.2';
t.head.appendChild(n);
}
};
e.init();
})(window, document);
</script>
<!-- End of TWT Chat code -->
tip
You can copy a prefilled version of this snippet with your appid from Settings > Website Code in the TWT Chat console.
Configuration Fields
| Field | Type | Required | Description |
|---|---|---|---|
appid | string | Yes | Unique application identifier from the console |
lang | string | No | UI language: zh-cn, zh-tw, or en |
theme | string | No | Theme mode: light or dark |
icon | string | No | Launcher style. "1" shows the default icon and "2" hides it |
sbs | string | No | Unique customer identifier |
sbs_mm | string | No | Customer signature |
ranstr | string | No | Random string, recommended to be 16 characters or longer |
name | string | No | Customer full name |
nickname | string | No | Customer alias |
email | string | No | Customer email |
phone | string | No | Customer phone number |
For details about customer identity fields, see URL Parameters and Customer Information.