I am trying to add web chat to my community portal and I have meshed together code from various examples, but it does not appear to work. Can someone help me determine what I am missing? I hit the buttons, but nothing launches.
Marketo Customer Cares ChatMarketo Customer Cares Live Chat
<table class="webchat-config">
<tbody>
<tr>
<th>First Name:</th>
<td><input type="text" id="firstName" value="" /></td>
</tr>
<tr>
<th>Last Name:</th>
<td><input type="text" id="lastName" value="" /></td>
</tr>
<tr>
<th>Contact Email:</th>
<td><input type="text" id="contactEmail" value="" /></td>
</tr>
</tbody>
</table>
<button type="button" onclick="startEmbeddedChat()">Start Embedded Chat</button>
<button type="button" onclick="startPopupChat()">Start Pop-up Chat</button>
var chatConfig = {};
function createChatConfig(){
var firstName = document.getElementById('firstName').value;
var lastName = document.getElementById('lastName').value;
var contactEmail = document.getElementById('contactEmail').value;
let chatConfig = {
"webchatAppUrl": "https://apps.mypurecloud.com/webchat",
"webchatServiceUrl": "https://realtime.mypurecloud.com:443",
"orgId": "16336",
"orgName": "marketo",
"queueName": "Customer Care",
"logLevel": "DEBUG",
"locale": "en",
"data": {
"firstName": "",
"lastName": "",
"contactEmail":"",
},
"companyLogo": {
"width": 600,
"height": 149,
"url": "https://marketo--c.na32.content.force.com/servlet/servlet.ImageServer?id=01538000002Epu3&oid=00D500000006sHb&lastMod=1504632059000"
},
"companyLogoSmall": {
"width": 25,
"height": 25,
"url": "https://marketo--c.na32.content.force.com/servlet/servlet.ImageServer?id=01538000002Epu8&oid=00D500000006sHb&lastMod=1504632405000"
},
"agentAvatar": {
"width": 462,
"height": 462,
"url": "https://d3a63qt71m2kua.cloudfront.net/developer-tools/552/assets/images/agent.jpg"
},
"welcomeMessage": "Thank you for connecting, one of our Customer Care representatives will be right with you.",
"cssClass": "webchat-frame",
"css": {
"width": "100%",
"height": "100%"
}
};
ININ.webchat.create(chatConfig, function(err, webchat) {
if (err) {
console.error(err);
throw err;
}
webchat.renderPopup({
width: 400,
height: 400,
title: 'Chat'
});
});