The primary objectives for integrating a chatbot are:
Chatbot contextualizing can be achieved depending on the use case making the context dynamic or static :
1.1. Static context : Used when the conversation has to be contextualized depending on static data that doesn’t change frequently.
Dialonce handles such context in different ways to cover all possible use cases :
1.1.1 According to page url : According to the page url where your widget is embedded we can run a regex to make the chatbot aware of the page context.
Example :
Process of integration :
1.2 Button clicked context : According to the html id of the clicked button on the page to open the chatbot, we are able to map a context that will be passed to the chatbot.
<button id="unique-id"></button>
Example : The chatbot is embedded on a web page (www.example.com/account) only available to admin users and you want the agent to display “admin” only features. You embed the widget and choose a unique html id for the button that opens the chatbot, for example “admin-only”.
<button id="admin-only"></button>
We will map “admin-only” to a context that makes the bot aware that he will only discuss with administrators, offering them “admin” features.
Process :
1.2. Dynamic context:
<aside> ⚠️ THIS FEATURE IS CURRENTLY UNDER DEVELOPMENT, THIS PART MIGHT BE SUBJECT TO CHANGE
</aside>
The client will be allowed to send dynamic information ( e.g. client id, account balance…) to the chatbot before the user session starts for a customized experience per session.
Example :
After the user logs into the page where the chatbot is embedded, you want it to be aware of his name, surname and userId.
Process :
Contact us to discuss which contextualization you want to setup so we can define what informations you have to pass in the window._dialonce.context object.
window._dialonce.context :<aside>
⚠️ window._dialonce.context should be defined quickly before the user clicks on the chatbot button, if it’s not found when the user clicks, the conversation will not be contextualized.
</aside>
<aside>
⚠️ window._dialonce.context.data If provided, this object must contain only string keys and string values
</aside>
window._dialonce.context = {
intent: "payer_documents", // intention initial, permet d'aller à un endroit précis de l'arbre
entities: {"documents":"facture", "produits":"éléctricité"}, // entité (mots clés) inital. Permet d'aller à un endroit précis de l'arbre grâce aux mots clés
startMessage: "Je veux avoir ma facture d'éléctricité pretty please", // attention, ce message permet d'overide l'intention et les entités et les remplacer par un message qui va être envoyé au chatbot
data: {
first_name:"John",
last_name: "Doe",
},
externalRef: "abcd" // Not part of context but will be used
// for tracking purposes
}
<aside> ⚠️ Notice that the externalRef is mandatory, it will be used to track sessions without personal data and also to provide KPIs if we have several contexts use cases for the same chatbot.
</aside>
intent: Represents the user's initial intention, which in this case is "payer_documents", directing the conversation to a specific part of the decision tree.entities: A dictionary of key entities (keywords) that help refine the conversation path. Here, the keyword "facture" (invoice) is used to navigate to the correct part of the decision tree.start_message: A custom user message ("Je veux avoir ma facture d'électricité pretty please") which, if provided, overrides the initial intent and entities to generate a chatbot response based on this message.data: Contains user-specific details such as "first_name" and "last_name" (e.g., John Doe).language: permet de filtre selon une langue pour une architecture multi-langue.brand: permet de filtrer selon la brand désiré pour des architectures multi-dimensionnel de chatbotexternalRef: A tracking reference ("abcd") that’s not directly part of the context but used externally for tracking purposes.availableLocales : comme pour availableLocales à la racine de chatbotParams, cet objet permet de définir les langues souhaitées dans un contexte statique uniquement.This comes in addition to the instructions for the ICP integration: ICP - Intelligent Contact Page
When needed to transmit context, you will be able to pass context via query parameters to the do-chat url.
Please follow these steps to transmit context: