After inserting the code (ssq is a global variable), you can make message changes and chat window calls by the following methods.
You can set user information after user login, and correspondingly you can see the set information in the customer service system.
ssq.push('setLoginInfo', {
user_id: 'b58e64cfxs2ym', // 必填,加密后的用户 id
user_name: 'test_yy', // 必填,用户名
language: 'ru-RU', // 插件语言
phone: '861592014xxxx', // 手机号码务必填写完整的带有国家区号的格式;未带区号的手机号码可能会产生识别国家地区错误或被识别为无效号码。
email: 'test@test', // 邮箱
description: '套餐B\n客户端\n收费客户', // 描述
});
You can manually clean up user login information for use in PWA sites, which is executed after logging out and not refreshing the page.
ssq.push('clearUser');
The chat window can be opened manually with the program for some special scenarios where users can be guided to consult customer service, such as payment failure.
ssq.push('chatOpen');
You can close the chat window manually with the program.
ssq.push('chatClose');
Monitor unread messages for custom message notifications.
ssq.push('onUnRead', function(obj) {
console.log(obj.num); // 未读数量
console.log(obj.list); // 未读内容
});
Custom icons can be implemented by combining ” monitor unread messages” and “open chat window”.
window.__ssc.setting = { hideIcon: true};
Monitor visitor messages and then perform data statistics or reporting, which can be used for advertising effectiveness statistics or attribution.
ssq.push('onSendMessage', function(obj) {
console.log(obj);
});
Monitor the information received by visitors and then perform data statistics or reporting, which can be used for advertising effectiveness statistics or attribution.
ssq.push('onReceiveMessage', function(obj) {
console.log(obj);
});
Monitor the open window, and then you perform data statistics or reporting, which can be used for advertising effectiveness statistics or attribution.
ssq.push('onOpenChat', function() {
// 上报数据
});
Monitor the closed window and you can report data for analysis.
ssq.push('onCloseChat', function() {
// 执行其他事件
});