https://support.zendesk.com/hc/en-us/articles/229167008?page=5#comment_360001007367
By Gab Guinto
To have the widget script load only upon clicking the button, you just have to insert this to your html:
<script>
function widget(d) {
var script = d.createElement('script');
script.type = 'text/javascript';
script.id = 'ze-snippet';
script.async = true;
script.src = 'https://static.zdassets.com/ekr/snippet.js?key=<key>';
d.getElementsByTagName('head')[0].appendChild(script);
};
</script>
Just replace <key> with your own widget key. We can't guarantee that it will work on your account, but we tested this and it worked on a test account.
Hope this helps.
Comments
1 comment
Also
https://support.zendesk.com/hc/en-us/articles/360039299153
Please sign in to leave a comment.