Reading the documentation of Zopim (a.k.a Zendesk Chat):
API calls must be inserted after the Live Chat Script and wrapped within $zopim(function() { ... })
So I have a the Zopim script in head
part of HTML:
<script>/*<![CDATA[*/window.zEmbed||function(e,t){ ... }("https://...);
/*]]>*/</script>
Then I added this at the end of HTML document:
$zopim(function() {
$zopim.livechat.setName('Logged in name');
$zopim.livechat.setEmail('[email protected]');
});
And console says:
$zopim is not defined
I think I have followed the instructions correctly. What did I miss?