This API allows you to add the additional information about the visitor and displays it to the agent in the visitor information section. These information are not visible to the visitors.

Note:

To push the values passed in the JSON object to CRM, create a new field with the same JSON key under Leads/Contacts/Visits module in CRM.
Example: A JSON object {"Band" : "Premium"} will update the value as Premium, if a custom field with name Band exists in your CRM.

Parameters

key : Field name to be used.

value : Value for the fields.

.visitor.question()

$zoho.salesiq.visitor.question(" < QUESTION > ");

You can use this API to pre-fill a question in the chat widget.

Example

<script>

$zoho.salesiq.visitor.question("I need a quote for the latest launch ");

</script>

Note:

This API can also be invoked using the Zoho SalesIQ global handler.

.visitor.customaction()

$zoho.salesiq.visitor.customaction(" < Any custom action > ");

This API will allow you to track and report the User defined custom action of the visitors in your SalesIQ. That is, SalesIQ will automatically track the pages on your website and report on the navigation path of the proactive chat, but with the help of this API you can even track the specific actions performed by the visitor in a page.

This API is not meant only for Onclick actions, but can be used anywhere in the page.

.visitor.id()

$zoho.salesiq.visitor.id(" < VISITOR ID > ");

Example

<script>

$zoho.salesiq.ready=function(embedinfo)

{

$zoho.salesiq.visitor.id("67465746");

}

</script>

This API sets a unique id each time the user logs in to Zoho SalesIQ with an email address. In this unique id a consistent user record such as past conversations is maintained even when the user logs in from another browser.

You need to enable the 'View Previous Chat Conversations' option to use this API.

This API allows you to display only the required departments in the pre-chat form. All other configured departments will be hidden regardless of their status. However Web Embed department settings should be configured as "Allow user to select department".

Parameters

online.department : To display only the online departments.

.chat.defaultdepartment()

$zoho.salesiq.chat.defaultdepartment(" < DEFAULT DEPARTMENT > ");

This API allows you to set a default department in the pre-chat form and the visitors are allowed to select other department if needed. However Web Embed department settings should be configured as "Allow user to select department".

Example

<script>

$zoho.salesiq.ready=function(embedinfo)

{

$zoho.salesiq.chat.defaultdepartment("Sales");

}

</script>

.chat.agent()

$zoho.salesiq.chat.agent(" < DEFAULT AGENT > ");

Use this API to route the chat to a specific agent for the first half of the waiting time. If not picked, the chat will be routed to other available agents.

Example

<script>

$zoho.salesiq.ready=function(embedinfo)

{

$zoho.salesiq.chat.agent("Johny.deskey@zillium.com");

}

</script>

.chat.forward()

$zoho.salesiq.chat.forward(<false>);

Example

<script>

$zoho.salesiq.ready=function(embedinfo)

{

$zoho.salesiq.chat.forward(false);

}

</script>

Use this API to disable chat forwarding to other agents. If the assigned agent could not pick the chat within the first half of the waiting time, these chats will not be forwarded to other agents and will be added under missed.

Parameters

false : To route the chats to a specific agent.

Note:

This API Can be used only for Personalized chat option and while using the API to set a default agent with the API "$zoho.salesiq.chat.agent".

.chat.title()

$zoho.salesiq.chat.title(" < TITLE > ");

This API allows you to set title for the chat. Disable the company logo in Web Embed settings to get the title displayed for Chat window, Float & Personalized Chat widget.

Example

<script>

$zoho.salesiq.ready=function(embedinfo)

{

$zoho.salesiq.chat.title("Ebay.in");

}

</script>

.chat.logo()

$zoho.salesiq.chat.logo(" < LOGO > ");

This API allows you to set logo for the chat widget. Make sure to enable the company logo in the Web Embed settings.

Example

<script>

$zoho.salesiq.ready=function(embedinfo)

{

$zoho.salesiq.chat.logo("Logo URL");

}

</script>

.chat.start()

$zoho.salesiq.chat.start();

You can use this API to initiate a chat, it should be invoked only on a JavaScript OnClick. Supported for all the type of embed.

$zoho.salesiq.chat.systemmessages({"agentinfomessage":"Would you need any help?"});

}

</script>

Parameters

waiting : This message will be displayed when a visitor is waiting after initiating the chat.

offline : This message will be displayed when all of your agents are in offline mode.

busy : This message will be displayed to the visitors when all your agents are busy and the chat waiting time has expired.

busycomplete : This message will be displayed to the visitors after submitting their request when all the agents are busy.

engaged : When the number of concurrent chats for a user reaches the configured ‘User concurrent chat limit’, the status of the user will be set as Engaged. Set the message to be displayed for the visitors when all the users are engaged.

engagedcomplete : When the visitor is displayed with the engaged status message, he also has an option to register for a response. Once he submits his details for a response, this message will be displayed to him.

prechatmessage : This message will be displayed to the visitor before initiating the chat when Name, Email address and Contact number field are hidden in the chat widget.

feedbackcomplete : This message will be displayed to your visitors after submitting the feedback. Feedbacks are scaled from one to five, you can have your own specific text for each level.

maxlength : Number of characters allowed. The default value is 30 and the maximum is 100.

visibility : To display the visibility of the fields. Default value is both.
online : Field will be visible only when the agents are online.
offline : Field will be visible only when the agents are offline.
both : Field will be visible always.

options : To provide option for the fields. Supported only for selectbox, checkbox & radio.
text : Label to be displayed for the visitor.
value : Value to be displayed for the agent in the visitor information.

Style : To set a style for the label. This option applicable for label.
font-size : To set the font size for a label.
color : To set the font color for a label.
textAlign : To set the font alignment for a label

before : To position the label before a specific field.
Specify the name of the field where you would like to include.This option applicable for label.

after : To position the label after a specific field.
Specify the name of the field where you would like to include.This option applicable for label.

callback : Specify the function to be invoked when a value is set for the field.

Parameters

feedback : Feedback given by the visitor to the agent who attended the chat.

agent : The email address of an agent who attends the chat.

.visitor.idle()

$zoho.salesiq.visitor.idle(function(){});

Note: This event will be triggered only when the visitor turns to idle state.

This event handler allows you to invoke a method, when the visitor turns to idle state.

Example

<script>

$zoho.salesiq.ready=function(embedinfo)

{

$zoho.salesiq.visitor.idle(function()

{

#insert your code here

});

}

</script>

.visitor.active()

$zoho.salesiq.visitor.active(function(){});

Note: This event will be triggered once the visitor resumes to an active state from idle.

This event handler allows you to invoke a method, when the visitor resumes to an active state from idle.

Example

<script>

$zoho.salesiq.ready=function(embedinfo)

{

$zoho.salesiq.visitor.active(function()

{

#insert your code here

});

}

</script>

.visitor.trigger()

$zoho.salesiq.visitor.trigger(function (triggername, visitorinfo);

{

// Your code here

});

Here, the triggername and the visitorinfo is passed as the parameter to this method.

Allows invoking your own custom trigger in the visitor’s landing page, if the visitor matches the configured condition.

To do so:

Implement this JS API in your website.

Set a rule for which the API should be triggered in the Settings -> Automation -> Intelligent Triggers and choose the Invoke JS API option in the Select an Option dropdown.

The API will be invoked when the visitor matches the rule. If trigger name is mentioned in the textbox then it will be passed as a parameter to the method. The second parameter contains available visitor information.

Example

In this example, two different rules are set by the user in the Settings -> Automation -> Intelligent Triggers. The Invoke JSAPI option is chosen from the Select an Option drop down and then the trigger name is mentioned in the text box as shown in the below screenshot.

In the first rule, the user wants to trigger some custom action and engage the visitor, who have visited the website more than 10 times but never initiated a chat.

In the second rule, the user wishes to display a discount banner only to the CRM users, who have CRM potentials closing this month.

Then, the following JS API is implemented in the website:

<script>

$zoho.salesiq.ready = function (embedinfo)

{

$zoho.salesiq.visitor.trigger(function (triggername, visitorinfo)

{

if (triggername == 'Engage')

{

engageReturningVisitor(); // Implement your custom action here

}

else if (triggername == 'Show Discount Banner')

{

showDiscountBanner(); // Implement your custom action here

}

});

// other JSAPIs here

}

</script>

Parameters

triggername : Configured trigger name in the rule.

visitorinfo : This JSON object contains the details of the visitor that are available from the following list:

name - Name of the Visitor

email - Email of the Visitor

phone - Contact number of the Visitor

browser - Browser name of the Visitor

os - Operating System of the Visitor

ip - IP address of the Visitor

ccode - Country code of the visitor

se - Search engine name if the Visitor landed on the site from a search engine

sk - Search query used if the Visitor landed on the site from a search engine

region - Region of the visitor (APAC/CANADA/EMEA/NA/SA)

state - State of the visitor

city - City of the visitor

chats - No of past chats with the visitor

visits - No of visits by the visitor

noofdays - No of days visitor has visited the site

totaltime - Total time duration the visitor spent on the site (in milliseconds)

fintime - Very first time (Unix time) at which the visitor landed on the site

lvtime - Last visited time of the visitor

Chat Event Handlers

.chat.online()

$zoho.salesiq.chat.online(function(){});Note: This event will be triggered only when the agents are online.

This event handler allows you to invoke a method, when the agents are online. This will be called once after the page is loaded.

Example

<script>

$zoho.salesiq.ready=function(embedinfo)

{

$zoho.salesiq.chat.online(function()

{

#insert your code here

});

}

</script>

.chat.offline()

$zoho.salesiq.chat.offline(function(){});Note: This event will be triggered only when the agents are offline.

This event handler allows you to invoke a method, when the agents are offline. This will be called once after the page is loaded.