To setup Live Chat to function with Zendesk you will need to create an extension within the Zendesk administration. You can setup the extensions within the Zendesk Administration > Settings > Extensions. You should then click Add Widget > Global JavaScript. The paste the following code. The Global JavaScript widget will insert the Chatstack JavaScript and Chatstack visitor tracking code on all your web pages.


var LiveHelpSettings = {};
LiveHelpSettings.server = 'www.example.com';
LiveHelpSettings.chatTab = true;
LiveHelpSettings.zendesk = true;

if (currentUser != 'undefined' && currentUser.isEndUser == true && currentUser.id != null && currentUser.name != 'Anonymous user') {
	LiveHelpSettings.name = currentUser.name;
	LiveHelpSettings.email = currentUser.email;
}

jQuery(document).ready(function() {

	// JavaScript
	var LiveHelp = document.createElement('script'); LiveHelp.type = 'text/javascript'; LiveHelp.async = true;
	LiveHelp.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + LiveHelpSettings.server + '/livehelp/scripts/jquery.livehelp.min.js';
	var s = document.getElementsByTagName('script')[0];
	s.parentNode.insertBefore(LiveHelp, s);
	
	var Zendesk = document.createElement('script'); LiveHelp.type = 'text/javascript'; Zendesk.async = true;
	Zendesk.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + LiveHelpSettings.server + '/livehelp/plugins/zendesk/jquery.livehelp.zendesk.js';
	s.parentNode.insertBefore(Zendesk, s);

});

One you have pasted the above code into the Zendesk Global JavaScript widget you will need to edit the following line near the bottom of the JavaScript code. You should change the bold text to the domain where you have installed the Chatstack software. Only add the domain to this text as the /livehelp/ folder will be added automatically.

LiveHelpSettings.url = 'www.example.com';

You can also create a Custom widget with the following code if you wish to display the Chatstack chat button on certain pages. You also need to edit the bold text within the code below to point to your Zendesk installation.

<!-- stardevelop.com Live Help International Copyright - All Rights Reserved //-->
<!-- BEGIN Live Help HTML Code - NOT PERMITTED TO MODIFY IMAGE MAP/CODE/LINKS //-->
<a href="#" target="_blank" class="LiveHelpButton">
<img src="http://www.example.com/livehelp/include/status.php" id="LiveHelpStatus" name="LiveHelpStatus" class="LiveHelpStatus" border="0" alt="Live Help" />
</a><!-- END Live Help HTML Code - NOT PERMITTED TO MODIFY IMAGE MAP/CODE/LINKS //-->