Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jittarao/9b2ef36418fb8ef4b6d353ba2419f2d6 to your computer and use it in GitHub Desktop.
Save jittarao/9b2ef36418fb8ef4b6d353ba2419f2d6 to your computer and use it in GitHub Desktop.
Send Gist events to an outside platform or customize Gist using specific actions done by your customers.
<!-- Make sure you add Gist snippet above this -->
<!-- This example shows listening to a variety of Gist client side events and logging their contents whenever they happen. -->
<script type="text/javascript">
document.addEventListener("gistChatReady", function(e) {
// Triggers when a new conversation has started
document.addEventListener('conversation:started', function (data) {
console.log('Conversation Started: ' + JSON.stringify(data.detail));
}, false);
// Triggers when a conversation has been opened
document.addEventListener('conversation:opened', function (data) {
console.log('Conversation Opened: ' + JSON.stringify(data.detail));
}, false);
// Triggers when a message has been sent
document.addEventListener('message:sent', function (data) {
console.log('Message Sent: ' + JSON.stringify(data.detail));
}, false);
// Triggers when a message has been received
document.addEventListener('message:received', function (data) {
console.log('Message Received: ' + JSON.stringify(data.detail));
}, false);
// Triggers when an email address has been captured
document.addEventListener('email:captured', function (data) {
console.log('Email Address Captured: ' + JSON.stringify(data.detail));
}, false);
// Triggers when the GDPR form has been submitted
document.addEventListener('gdpr:clicked', function (data) {
console.log('GDPR Consent Submitted: ' + JSON.stringify(data.detail));
}, false);
// Triggers when the Messenger has been opened
document.addEventListener('messenger:opened', function (data) {
console.log('Messenger Opened: ' + JSON.stringify(data.detail));
}, false);
// Triggers when the Messenger has been closed
document.addEventListener('messenger:closed', function (data) {
console.log('Messenger Closed: ' + JSON.stringify(data.detail));
}, false);
// Triggers when a meeting has been requested
document.addEventListener('meeting:requested', function (data) {
console.log('Meeting Requested: ' + JSON.stringify(data.detail));
}, false);
// Triggers when a meeting has been scheduled
document.addEventListener('meeting:booked', function (data) {
console.log('Meeting Booked: ' + JSON.stringify(data.detail));
}, false);
// Triggers when a satisfaction rating has been left
document.addEventListener('conversation:feedback', function (data) {
console.log('Conversation Feedback Submitted: ' + JSON.stringify(data.detail));
}, false);
// Triggers when an in-app chat message has been sent
document.addEventListener('triggeredMessage:fired', function (data) {
console.log('Triggered Message Fired: ' + JSON.stringify(data.detail));
}, false);
// Triggers when an in-app chat message has been clicked
document.addEventListener('triggeredMessage:clicked', function (data) {
console.log('Triggered Message Clicked: ' + JSON.stringify(data.detail));
}, false);
// Triggers when an in-app chat message has been dismissed
document.addEventListener('triggeredMessage:dismissed', function (data) {
console.log('Triggered Message Dismissed: ' + JSON.stringify(data.detail));
}, false);
// Triggers when a chat bot has been triggered
document.addEventListener('chatbot:fired', function (data) {
console.log('Bot Fired: ' + JSON.stringify(data.detail));
}, false);
// Triggers when a button response in a chatbot has been clicked
document.addEventListener('chatbot:buttonClicked', function (data) {
console.log('Bot Button Clicked: ' + JSON.stringify(data.detail));
}, false);
// Triggers when an article has been searched
document.addEventListener('article:searched', function (data) {
console.log('Article Searched: ' + JSON.stringify(data.detail));
}, false);
// Triggers when an article has been viewed
document.addEventListener('article:viewed', function (data) {
console.log('Article Viewed: ' + JSON.stringify(data.detail));
}, false);
// Triggers when feedback has been left for an article
document.addEventListener('article:feedback', function (data) {
console.log('Article Feedback Submitted: ' + JSON.stringify(data.detail));
}, false);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment