I am trying to use Tawk_API.login to fetch our client contact with Tawk_API.onload function. We can fetch it, but somehow the live chat is flashing non stop after a few seconds as the video linked. Our embeded script as follow:
<script type="text/javascript">
var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
(function(){
var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
s1.async=true;
s1.src='LINK HERE';
s1.charset='UTF-8';
s1.setAttribute('crossorigin','*');
s0.parentNode.insertBefore(s1,s0);
Tawk_API.onLoad = function(){
Tawk_API.login({
hash : 'hashed value', // required
userId : 'Client ID', // required
name : 'Client Name from database'
}, function(error) {
// do something if error
})
}
})()
</script>
Also when we add phone number to the login function, it is getting a bad request error.
Another question, we would like to know if the user data is not in our contact, will the api pass the information to create a new contact?
video as follow: