Save the time that your visitors spend on filling the fields in the chat window while trying to initiate a chat with the operators of your firm,
Say you own an e-commerce page, you obviously would have procured prime particulars of the visitors visiting your page via a sign up form, then why not retrieve it and utilize it instead of prompting the visitors to enter their name, email address and contact number over and over again?
Shall we just consider a quick and simple example on how to use the following JS APIs to get your job done?
- $zoho.salesiq.visitor.name();
- $zoho.salesiq.visitor.email();
- $zoho.salesiq.visitor.contactnumber();
Say you create a sign up form prompting for the following particulars,
- <form id="myForm" action="/shop.html" method="post">
- First name: <input type="text" name="fname"><br>
- email: <input type="text" name="email"><br>
- Phone: <input type="number" name="phone"><br>
- <input type="submit" value="Submit" onclick="myFunction()">
- </form>
Okay now say you have procured the details, how do I retrieve it and use it?
- <script>
- function myFunction() {
- var x = document.getElementById("myForm").elements[0].value;
- var y = document.getElementById("myForm").elements[1].value;
- var z = document.getElementById("myForm").elements[2].value;
- $zoho.salesiq.visitor.name(x);
- $zoho.salesiq.visitor.email(y);
- $zoho.salesiq.visitor.contactnumber(z);
- }
- </script>
Once the method "ready()" inside the Zoho SalesIQ widget code is called, the values retrieved will be captured and will be set in the configured fields in the visitor chat window,
- <script type="text/javascript">
- var $zoho=$zoho || {};$zoho.salesiq = $zoho.salesiq ||
- {widgetcode:"6369d474198d4fc9604656182c9c4e3ee6da94a87bb0400877114fe25f2803f64c9df2e59248c8d7bfee986a890ef9d0",
- values:{},ready:function(){}};var
- d=document;s=d.createElement("script");s.type="text/javascript";s.id="zsiqscript";
- s.defer=true;s.src=" ];
- t.parentNode.insertBefore(s,t);d.write("<div id='zsiqwidget'></div>");
- $zoho.salesiq.ready=function(embedinfo)
- {
- $zoho.salesiq.visitor.name();
- $zoho.salesiq.visitor.email();
- $zoho.salesiq.visitor.contactnumber();
- }
- </script>
If you are not ready to get all geeky and use JS APIs to get your job done, you can also use Zoho SalesIQ's auto-pick mechanism to achieve the same results ,
- <form id="myForm" action="/shop.html" method="post">
- First name: <input type="text" name="name" siqatrib="name"/><br>
- email: <input type="text" name="email" siqatrib="email"/><br>
- Phone: <input type="number" name="phone" siqatrib="phone"/><br>
- <input type="submit" value="Submit" onclick="myFunction()">
- </form>