|
The integration of a 'Click for Live Help' button is carried out by inserting a piece of code into site pages. The best way to make the button accessible from any page of the site would be to include the button code in a template contained in each of the site pages. If for some reason the code cannot be included in such a way, you have to insert it into each of the pages of your site manually.
When inserting the code into a web page, make sure you place it within the body of the page. Create the necessary code using the HTML Code Generator or manually by using the following template:
<!-- [Sales-n-Stats live help button] -->
<table cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<a id="snsOperatorButtonLink"
href="{CollectorRoot}/leaveMessage.php?noscript=true"><img style="cursor: pointer"
onclick="window.open('{CollectorRoot}/openChat.php?tsh={TemplateSetHint}',
'_blank',
'status=yes,toolbar=no,menubar=no,location=no,width=500,height=400'); return false;"
border="0" src="<collector url>/operatorButton.js.php?btn={ButtonName}"
id="snsOperatorButton" alt="Powered by Sales-n-Stats" />
</a>
<script type="text/javascript">
<!--
var snsCustomOfflineMessageUrl = '{CustomOfflineMessageUrl}';
//-->
</script>
</td>
</tr>
<tr>
<td height="15" align="center" nowrap="nowrap">
<font size="1" face="Arial"><a href="http://www.sales-n-stats.com"
style="text-decoration: none; color: #550000"
target="_blank"><b>Powered by Sales-n-Stats</b></a></font>
</td>
</tr>
</table>
<!-- [/Sales-n-Stats live help button] -->
where:
| • | {CollectorRoot} is the full URL of the Data Collector directory you entered in the process of Sales-n-Stats installation (such as http://example.com/my/collector/path). This URL must coincide with the cookie domain and cookie path in the Data Collector. If it is not the same, an error message "Sales-n-Stats is integrated incorrectly" will be shown when Open Chat window is displayed. |
| • | {TemplateSetHint} is the template set, which will be used in the "Open Chat", "Route Call" и "Chat Window" dialogs. Default value is an empty string. If a non-existing template set is specified, the template set name is empty or the tsh parameter is omitted, the default template set will be used. |
| • | tsh=default means that the default template set should be used to show pushed content and chat invitations. If you want to use a different template set, replace 'default' with your template folder name. |
| • | {CustomOfflineMessageUrl} is the alternative URL for the 'Contact us' page. If the operator button is in the 'Leave a message' state, this URL will be retrieved. If this parameter is not set, the standard mechanism for leaving offline messages will be used. |
| • | {ButtonName} is the name of the button set, which will be used for operator buttons. |
| • | btn=4a means that in the example code, the image files for 'Live help' and 'Leave a message' buttons will be named '4alive_help.gif' and '4aleave_message.gif' correspondingly and located in {CollectorRoot}/buttons directory. |
(*) the onclick attribute in the <a> tag is necessary for compatability with collectors older than version 2.0. If you do not plan to use an older collector, this attribute may be omitted from the integration code.
| Note: | To ensure correct operation of the site tracker specify the location of the button script by entering the absolute path to the Data Collector. |
By default the button is displayed as an image. If you need the button to be displayed as a link (in text mode), edit the inserted code, so it looks like this:
<script src="{CollectorRoot}/operatorButton.js.php?mode=text">
</script>
|