CloudRadial provides the ability to inject Javascript scripts into CloudRadial. These scripts are loaded on page load before the application starts or users have either logged in or been identified.
This feature is considered experimental and we are not able to offer much help with how to interact with your chat widget. Using this feature requires a solid understanding of Javascript and is subject to change.
Setting Up Chat Header Scripts
You can establish chat widgets in your portal via the Header Scripts found under:
Partner > Settings > Integrations (under the Configuration column) > Header Scripts
To interact with these chat widgets, CloudRadial now calls the Javascript function "CloudRadialUserInit" which is called after a user has been identified through login or session refresh and CloudRadialUserLogout which is called when a user uses the Log Out option from their profile menu.
Example for Zendesk Chat
Information on working with the Zendesk Chat client can be found here:
Core API - Web Widget - Zendesk Developer Portal
Using this code, then you would add the following javascript code to the header scripts section in CloudRadial.
<script>
function CloudRadialUserInit(email, displayname, companyname) {
//console.log(email);
//console.log(displayname);
//console.log(companyname);
zE('webWidget', 'prefill', {
name: {
value: displayname,
readOnly: true // optional
},
email: {
value: email,
readOnly: true // optional
}
});
}
function CloudRadialUserLogout() {
zE('webWidget', 'prefill', {
name: {
value: '',
readOnly: false
},
email: {
value: '',
readOnly: false
}
});
}
</script>
Comments
0 comments
Article is closed for comments.