
How to make your widget invisible when the chat is offline?
It is possible to make the Website Widget invisible at the moment the website chat is offline.
This can be done by adapting your embed code as follows:
window.Trengo = window.Trengo || {};
window.Trengo.key = '[your website widget's key]';
(function(d, script, t) {
window.Trengo.on_status_offline = function() {
document.getElementById('trengo-web-widget').style.display = 'none';
};
script = d.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.src = 'https://static.widget.trengo.eu/embed.js';;
d.getElementsByTagName('head')[0].appendChild(script);
}(document));
Like
Follow
1
Reply