LogoLogo
  • A better way to do...stuff!
  • How we build the app
    • Overview
  • Documentation
    • Draftbit
      • Using Live Preview
      • Workspaces and Billing
      • Introduction to the Builder
      • Layout
      • Intro to Navigation
      • Fetching Data
      • Direct Integrations
      • FAQs
      • Draftbit
      • Draftbit
      • Custom Blocks
      • Borders, Background, and Elevation
      • Actions
      • Custom Screen Code
      • Exporting and Publishing Your Project
      • Sharing Your Project Online
      • Publishing Your App as a PWA
      • Stack Navigator
      • Tab Navigator
      • Draftbit
      • Draftbit
      • Basic
      • Media
      • REST Services & Endpoints
      • REST API Integrations
      • Themes & Styling
      • Submitting Data
      • Draftbit
      • Draftbit
    • Xano
      • resources-and-tips-1
        • 🎞️ Xano Video Tutorials
        • 🤝Community Corner
        • 💰Share Xano. Make money
      • FAQ
      • getting-started
        • ⚡ Jumpstart
        • 🎞️ The Xano Interface
      • instances
        • What is an Instance?
        • Early Access Instance
        • Upgrading an Instance
        • Sharing
        • Bandwidth Usage
        • API Rate Limit
      • What is a Workspace?
      • Dashboard
      • Database
      • Airtable Import
      • API
      • Library
      • Marketplace
      • Settings
      • authentication
        • Authentication
        • Sign-up & Log in
      • data-manipulation
        • The Function Stack
        • Addons (GraphQL-Like)
        • The Expression Builder
        • External Query Manipulation
        • Timestamp
        • Filters
        • Images
    • Expo
      • Creating your first build - Expo Documentation
    • Kommunicate
      • Installation
      • Installation
      • Installation
      • Installation
      • Installation
      • Flutter Installation
      • Installation
      • Zapier Integration
      • Authentication
      • CMS Installation
      • Authentication
      • Conversation
      • Conversation Assignment
      • Customization
      • Localization
      • Logout
      • Web Troubleshooting
      • Installation
      • Authentication
      • Push Notification
      • Conversation
      • Customization
      • Localization
      • Logout
      • Installation
      • Authentication
      • Push Notification
      • Conversation
      • Customization
    • Formito
      • basics
        • Getting Started
        • Variables
        • Are you GDPR ready?
        • How to prefill the values of my chatbot?
      • connect
        • How to connect Formito to Zapier?
      • convert
        • How to convert old formito chatbots to the new version?
        • How to convert Google Forms into a chatbot?
        • How to convert a Monday.com board to a chatbot?
        • How to create chatbot from QuickBase table?
      • guide
        • How to add my chatbot to WordPress?
        • How to create a chatbot for Zendesk?
      • shopify
        • How to embed my chatbot into a Shopify page?
        • How to display Formito chatbot on bottom corner of my Shopify store?
        • How to open my chatbot after clicking on links or buttons?
    • Stonly
  • Flex Stuff
    • App
    • APIs
    • Database
    • Website
    • Design
    • Style Guide
  • Content
    • Guides
    • ChatBots
    • Blogs
    • Whitepapers
  • Company
    • About us
    • Brand
    • Roadmap
    • Policies
  • Flex Together
    • Overview
    • Fair Finance
Powered by GitBook
On this page
  • Overview
  • Conversations
  • Conversation Settings
  • Launch conversation List
  • Assign different bot to different website pages
  • Initiate conversation with specific team
  • Create a new conversation
  • Open a particular conversation
  • Open chat window when a new message comes
  • Start a new session every time a user visits again

Was this helpful?

  1. Documentation
  2. Kommunicate

Conversation

Overview

This section is dedicated to launching and managing conversations in the chat widget on certain triggers. For example, the chat widget will only appear on the website on click of a specific button. This could be useful if you wish to show support chat only on certain triggers and not all the time.

Conversations

Conversation Settings

Kommunicate provides some parameter to configure the conversation rules when it is created. These parameters can be used to override the conversation rules you have set from dashboard. These parameters can be set using the Kommunicate.updateSettings() methods. The updated setting will be effective from the next conversation user creates by either clicking on the Start new conversation on chat widget or calling the Kommunicate.startConversation().

Below is the sample code to update the conversation setting:

var defaultSettings = {
    "defaultAgentIds": [""],
    "defaultBotIds": [""], 
    "defaultAssignee": "", 
    "skipBotEvent": '[""]', 
    "skipRouting": true,
    "teamId": <TEAM_ID> 
};    
Kommunicate.updateSettings(defaultSettings);  

Below is the detail about the supported parameters:

Parameters

Type

Default value

Descriptions

defaultAssignee

string

Configured routing rules for agents from dashboard

defaultAgentIds

array

Configured routing rules for agents from dashboard

You can pass the default agents that you want to be present in every new conversation created.

defaultBotIds

array

Configured routing rules for bots from dashboard

You can pass the default bots that you want to be present in every new conversation created.

WELCOME_MESSAGE

string

Configured from dashboard

You can pass the default welcome message here and it will override the welcome message which you have set from dashboard. NOTE: It will not override the welcome message sent by your bot.

skipRouting

boolean

false

skipBotEvent

array

None

teamId

number

All conversations will be assigned to default team.

Example : Assigning conversations to a specific bot/agent on certain events

Usecase: A user comes to your website and starts a conversation with support agents. When user navigates to another page you wants to start conversation with another agents or bots. You can achieve this by updating the conversation rules dynamically. Set the appropriate values in above mentioned parameters and Kommunicate will use these parameters while creating the conversation. You can update the empty values when user navigate to previous page to make old conversation rules(set from dashboard) effective. Below is the sample code for the same:



var defaultSettings = {
    "defaultAgentIds": [""], 
    "defaultBotIds": [""], 
    "defaultAssignee": "", 
    "skipRouting": true
};
Kommunicate.updateSettings(defaultSettings);  

Launch conversation List

To launch the chat widget and conversation list, use the following method.

Kommunicate.launchConversation();

How it works ?

  1. Initially, if there are no previous conversations, then it will create a new conversation and open it.

  2. If you have old/previous conversations, it will open the conversation list.

Assign different bot to different website pages

In order to change widget's default settings like default bots in conversation and default assignee, you need to create defaultSettings object with two parameters, defaultBotIds containing list of bot ids which you wish to add in conversation, defaultAssignee having string value to the agent/bot which you wish to assign conversation by default.

(function(d, m){
    
    var defaultSettings = {
    "defaultBotIds": [""], 
    "defaultAssignee": "", 
    "skipRouting":true
    };
    var kommunicateSettings = {
        "appId":"",  
        "automaticChatOpenOnNavigation":false,
        "onInit": function() {
            Kommunicate.updateSettings(defaultSettings); 
        }
    };
    
    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 || {});

Initiate conversation with specific team

To start a conversation with a specific team, one can create defaultSettings object with teamId parameter. These parameters can be set using the Kommunicate.updateSettings() method.

Below is the sample code to update the conversation setting:

(function(d, m){
    var defaultSettings = {
    "teamId": "" 
    };
    var kommunicateSettings = {
        "appId":"",  
        "automaticChatOpenOnNavigation":false,
        "onInit": function() {
            Kommunicate.updateSettings(defaultSettings); 
        }
    };
    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 || {});

Create a new conversation

A conversation can be created using startConversation method. Below is the example code for the same. You can choose to define certain parameters to profile this conversation and allot assignee.


Kommunicate.startConversation(); 

Note: You have to set "automaticChatOpenOnNavigation" parameter to false as this option won't be compatible with startConversation method.


var conversationDetail = {
    "defaultGroupName": "", 
    "agentIds": [""], 
    "botIds": [""], 
    "skipRouting":"true", 
    "assignee":" or " 
};
Kommunicate.startConversation(conversationDetail, function (response) {
    console.log("new conversation created");
});                    
var defaultSettings = {
    "defaultBotIds": [""], 
    "defaultAssignee": "", 
    "skipRouting": true
};
Kommunicate.updateSettings(defaultSettings); 


Kommunicate.startConversation(); 

Open a particular conversation

If you wish to open a particular conversation, pass the group ID of that conversation by using the method mentioned below:

Kommunicate.openConversation();

Open chat window when a new message comes

If you want the chat window to pop open when a new conversation comes, add "openConversationOnNewMessage": true in kommunicateSettings object. This will open the chat window when a new message comes.


    var kommunicateSettings = {
        ...
        "appId": "",
        "openConversationOnNewMessage":true
        ...
    };

Start a new session every time a user visits again

PreviousAuthenticationNextConversation Assignment

Last updated 4 years ago

Was this helpful?

You need to pass the agentId/botId. If nothing is passed the default agent will automatically get selected. NOTE: You need to pass "skipRouting": true with defaultAssignee parameter if you have assigned a default assignee from the section

If you pass this value true then it will skip routing rules set from section.

You can pass the bot event names that you want to skip in every new conversation created. Read more about bot events

Assign conversations to a particular team by passing teamId and the conversation assignment will be based your assigned team rules. Get team ID from

Note: If called with empty parameters it will inherits the conversation rules from object. It can be helpful to set conversation rules dynamically. Refer to below example :

Kommunicate expires the user session if a user is anonymous and inactive for 30 days. If a user comes back to your website within 30 days then the old conversations of the user will be visible. If you want to start a new session every time user comes to your website then change the settings in the kommunicate where all the existing info and previous messages will be removed from the chat widget after a set period of time.

dashboard
conversation settings
conversation rules
conversation rules
here
teammates section