Skip to content

Commit

Permalink
Merge pull request #507 from Kommunicate-io/harishbala1o-patch-1
Browse files Browse the repository at this point in the history
Open chat widget on page load
  • Loading branch information
devashishmamgain authored Jun 27, 2020
2 parents 4aeeb78 + 0f477d6 commit 789e3a3
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions example/Page_load.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!doctype html>
<html lang="en">
<head>
<title>Open Chat widget on page load</title>
</head>
<body>
<h1> This sample code will help you to open the chat widget automatically on page load</h1>

< script type = "text/javascript" >
(function (d, m) {
var kommunicateSettings = {
"appId": "kommunicate-support",
"popupWidget": true,
"automaticChatOpenOnNavigation": true,
"onInit": function () {
Kommunicate.launchConversation();
}
};
var s = document.createElement("script");
s.type = "text/javascript";
s.async = true;
s.src = "https://widget.kommunicate.io/v2/kommunicate.app";
var h = document.getElementsByTagName("head")[0];
h.appendChild(s);
window.kommunicate = m;
m._globals = kommunicateSettings;
})(document, window.kommunicate || {});
</script>

<h1> Note: Please replace "kommunicate-support" with your account APP_ID from the <a href="https://dashboard.kommunicate.io/settings/install"> Install </a>
section to get your APP_ID
</h1>
</body>
</html>

0 comments on commit 789e3a3

Please sign in to comment.