I want to add a Smartsupp chat box to my site, but I’m not sure how to apply the feature I want. I don’t want to run the script every time, it’s useless for me and I want to wait for the user’s reaction. So if the user clicks on the button, the script will only run on the page.
Can you advise me what is the most efficient method for this feature?
<!-- Smartsupp Live Chat script -->
<script type="text/javascript">
var _smartsupp = _smartsupp || {};
_smartsupp.key = '123456789123456789123456789';
window.smartsupp||(function(d) {
var s,c,o=smartsupp=function(){ o._.push(arguments)};o._=[];
s=d.getElementsByTagName('script')[0];c=d.createElement('script');
c.type='text/javascript';c.charset='utf-8';c.async=true;
c.src='https://www.smartsuppchat.com/loader.js?';s.parentNode.insertBefore(c,s);
})(document);
</script>