Customizing Webchat 2.0

Modified on Sat, 31 Aug at 1:13 AM

Comprehensive Guide for Customizing Your Webchat


Introduction

Chatbot BuilderWebchat allows you to easily integrate a chatbot on your website without needing third-party platforms. This guide will help you set up and customize your webchat, including changing the chat bubble icon and controlling its size, with easy-to-follow steps for non-coders and beginners.


Embedding the Webchat Code into Your Website

Steps to Embed Webchat

  1. Navigate to Settings (Inside Your CBB Account)
    Go to Settings > Channels > Web Chatbot > Manage inside your CBB account.

  2. Add Authorized Websites (Inside the Manage Webchat Section)
    Inside the Manage Webchat section, add your website domain or subdomain to the authorized websites list. The chatbot will only load on these authorized sites.

  3. Get the Webchat Code (Inside the Manage Webchat Section)
    After creating and saving your Webchat inside your CBB account, click the three dots in the Manage Webchat section to get the code.

  4. Insert the Code into Your Website
    Warning: Always ensure that both IDs (YOUR-WEBCHAT-ID and YOUR-ACCOUNT-ID) provided in the Webchat section are included in the script.

    Example code to insert:

    <script src="https://app.chatgptbuilder.io/webchat/plugin.js?v=5"></script>   <script>   ktt10.setup({   id: "YOUR-WEBCHAT-ID",  // Webchat ID   accountId: "YOUR-ACCOUNT-ID",  // Account ID   color: "#36D6B5"   });   </script>

    This code will embed the webchat on your website, ensuring proper functionality with both required IDs.


Webchat Customization Table

Follow the instructions below to insert the necessary CSS or scripts into the designated areas of your Webchat Editor in CBB for customizing your chatbot interface.



#CSS ClassDescriptionExample Implementation
1.chat-headerStyles the chat header area..chat-header { background-color: #f4f4f4; padding: 10px; }
2.m-0Removes all margins (margin: 0)..m-0 { margin: 0; }
3.py-3Adds padding to the top and bottom (padding: 1rem)..py-3 { padding-top: 1rem; padding-bottom: 1rem; }
4.chat-areaStyles the main chat area..chat-area { background: linear-gradient(90deg, #FFDEE9 0%, #B5FFFC 100%); padding: 20px; }
5.py-4Adds padding to the top and bottom (padding: 1.5rem)..py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
6.px-4Adds padding to the left and right (padding: 1.5rem)..px-4 { padding-left: 1.5rem; padding-right: 1.5rem; }
7.chat-area2Alternate styling for the chat area when the header is hidden..chat-area2 { background-color: #e0f7fa; }
8.my-messageStyles the user's own chat messages..my-message { background-color: #d1e7dd; padding: 10px; border-radius: 10px; }
9.animate__animatedApplies animation to the element (from Animate.css library)..animate__animated { animation-duration: 1s; }
10.animate__slideInRightAnimates the element with a slide-in-from-right effect (from Animate.css library)..animate__slideInRight { animation-name: slideInRight; }
11.other-messageStyles the chat messages from others..other-message { background-color: #f8d7da; padding: 10px; border-radius: 10px; }
12.animate__slideInLeftAnimates the element with a slide-in-from-left effect (from Animate.css library)..animate__slideInLeft { animation-name: slideInLeft; }
13.clearfixClears floats on both sides of the element..clearfix { clear: both; }
14.chat-avatarStyles the avatar image in the chat..chat-avatar { width: 40px; height: 40px; border-radius: 50%; }
15.float-leftFloats the element to the left..float-left { float: left; }
16.mr-2Adds right margin (margin-right: 0.5rem)..mr-2 { margin-right: 0.5rem; }
17.mt-2Adds top margin (margin-top: 0.5rem)..mt-2 { margin-top: 0.5rem; }
18.my-0Removes top and bottom margins (margin-top: 0; margin-bottom: 0)..my-0 { margin-top: 0; margin-bottom: 0; }
19.px-4Adds padding to the left and right (padding: 1.5rem)..px-4 { padding-left: 1.5rem; padding-right: 1.5rem; }
20.text-centerCenters text horizontally within the element..text-center { text-align: center; }
21.text-secondaryApplies secondary color styling to the text..text-secondary { color: #6c757d; }
22.messageStyles the message content area..message { padding: 10px; border-radius: 8px; }
23.my-2Adds vertical margins (margin-top: 0.5rem; margin-bottom: 0.5rem)..my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
24.message-textStyles the text content inside a message..message-text { font-size: 14px; }
25.m-0Removes all margins (margin: 0)..m-0 { margin: 0; }
26.message-attachStyles the container for attached media inside messages..message-attach { padding: 10px; }
27.message-attach-bigStyles larger attached media inside messages..message-attach-big { padding: 20px; }
28.flowApplies flow-related styling to the element..flow { display: flex; }
29.flow-textStyles text inside elements related to a flow..flow-text { font-size: 16px; }
30.div_flow_contentStyles the content container inside a flow..div_flow_content { padding: 15px; }
31.pb-0Removes padding from the bottom (padding-bottom: 0)..pb-0 { padding-bottom: 0; }
32.textarea_cStyles the text area container..textarea_c { padding: 10px; }
33.div_text_cStyles the text content inside a text area..div_text_c { font-size: 14px; }
34.div_bttsStyles the button container inside a flow or message..div_btts { display: flex; justify-content: space-around; }
35.p_add_bttStyles additional buttons in the chat interface..p_add_btt { padding: 10px; background-color: #007bff; color: white; }
36.falStyles the icons from Font Awesome Light (FAL)..fal { font-size: 16px; }
37.fa-fileStyles the file icon from Font Awesome..fa-file { color: #6c757d; }
38.hideHides the element from the view (display: none)..hide { display: none; }
39.d-flexApplies flexbox layout to the element..d-flex { display: flex; }
40.align-items-centerVertically centers flex items within the flex container..align-items-center { align-items: center; }
41.message-attach-midiaStyles media attachments inside messages (like images or videos)..message-attach-midia { max-width: 100%; border-radius: 8px; }
42.carouselStyles the carousel container for sliding elements..carousel { width: 100%; overflow: hidden; }
43.slideStyles each slide in a carousel..slide { transition: transform 0.5s ease; }
44.carousel-innerStyles the inner container of a carousel that holds slides..carousel-inner { display: flex; }
45.carousel-itemStyles individual items inside a carousel..carousel-item { min-width: 100%; }
46.div_c2Styles a specific content container inside the chat..div_c2 { padding: 20px; }
47.pt-0Removes padding from the top (padding-top: 0)..pt-0 { padding-top: 0; }
48.img-boxStyles the container holding an image..img-box { display: inline-block; }
49.r_horizontalStyles images with a horizontal aspect ratio..r_horizontal { aspect-ratio: 16/9; }
50.bg-whiteApplies a white background color to the element..bg-white { background-color: white; }
51.quick-replyStyles quick reply buttons in the chat interface..quick-reply { background-color: #17a2b8; color: white; border-radius: 50px; }
52.pillApplies rounded corners to buttons (pill-shaped)..pill { border-radius: 50px; }
53.mt-3Adds top margin (margin-top: 1rem)..mt-3 { margin-top: 1rem; }
54.shadow-smAdds a small shadow to the element..shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); }
55.poweredStyles the "powered by" message at the bottom of the chat..powered { font-size: 12px; text-align: center; color: #6c757d; }
56.flex-wrapEnables wrapping of flex items inside the container..flex-wrap { flex-wrap: wrap; }
57.pr-3Adds right padding (padding-right: 1rem)..pr-3 { padding-right: 1rem; }
58.pl-4Adds left padding (padding-left: 1.5rem)..pl-4 { padding-left: 1.5rem; }
59.pr-2Adds right padding (padding-right: 0.5rem)..pr-2 { padding-right: 0.5rem; }
60.cursor_pointerChanges the cursor to a pointer (hand icon)..cursor_pointer { cursor: pointer; }
61.bg-light-hoverApplies a light background color when hovered..bg-light-hover:hover { background-color: #f8f9fa; }
62.uploadBttStyles the upload button in the chat interface..uploadBtt { background-color: #007bff; color: white; padding: 10px; border-radius: 50px; }
63.spinner-growStyles the growing spinner loader..spinner-grow { width: 2rem; height: 2rem; animation: spinner-grow 0.75s linear infinite; }
64.mr-2Adds right margin (margin-right: 0.5rem)..mr-2 { margin-right: 0.5rem; }
65.composerCStyles the message composer container..composerC { display: flex; padding: 10px; background-color: #f4f4f4; }
66.input-groupStyles input groups for forms or chat inputs..input-group { display: flex; }
67.form-controlStyles form controls like input fields..form-control { width: 100%; padding: 10px; }
68.input-group-appendStyles appended elements to input groups..input-group-append { margin-left: -1px; }
69.dropdownStyles the dropdown menu container..dropdown { position: relative; }
70.dropupStyles the dropdown menu as a "drop-up" container..dropup { position: relative; }
71.dropdown-toggleStyles the button that toggles the dropdown menu..dropdown-toggle { background-color: #007bff; color: white; }
72.dropdown-menuStyles the dropdown menu container..dropdown-menu { background-color: white; border-radius: 4px; }
73.dropdown-itemStyles individual items inside a dropdown menu..dropdown-item { padding: 10px; color: #333; }
74.chat-ice-breakerStyles the container for icebreaker buttons in the chat interface..chat-ice-breaker { text-align: right; }
75.text-rightAligns text to the right..text-right { text-align: right; }
76.btn-outline-primaryStyles buttons with an outlined primary color..btn-outline-primary { border: 1px solid #007bff; color: #007bff; }
77.flex-wrapEnables wrapping of flex items inside the container..flex-wrap { flex-wrap: wrap; }
78.input-groupStyles input groups for forms or chat inputs..input-group { display: flex; }
79
pre
Controls the text size and formatting for user and bot messages in the chat interface.
pre { white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; font-size: 14px; font-weight: normal; font-family: Helvetica, Arial, sans-serif; }
80.ktt10-btn
Adjusts the size of the webchat bubble. You can change both the width and height to resize the button. 

Important: 
This CSS does NOT go in the designated CSS area, and instead should be added to your code separately and directly on your website or landing page.
html <style> .ktt10-btn { width: 50px !important; height: 50px !important; } </style> This will make the webchat bubble 50px by 50px.
81.ktt10-btn img
Adjusts the size of the icon inside the chat bubble, keeping it proportional. 

Important: 
This CSS does NOT go in the designated CSS area, and instead should be added to your code separately and directly on your website or landing page.
css .ktt10-btn img { height: 50px !important; width: 50px !important; object-fit: contain !important; } This will resize the icon to 50px by 50px.


Switching Webchat Templates (Inside the Webchat Editor in Your CBB Account)

Warning: Insert the following code into the designated script area inside your Webchat Editor.

<script src="https://app.chatgptbuilder.io/webchat/plugin.js"></script> <script> ktt10.setup({ pageId: "YOUR-ACCOUNT-ID", color: "#007BFF", hideHeader: true, template: "template1" }); </script>


Displaying the Account Profile Picture as a Persona (Inside the Webchat Editor in Your CBB Account)

Warning: Insert the following code into the designated script area inside your Webchat Editor.

<script src="https://app.chatgptbuilder.io/webchat/plugin.js"></script> <script> ktt10.setup({ pageId: "YOUR-ACCOUNT-ID", showPersona: true }); </script>


Modifying the Chat Icon (Inside the Webchat Editor in Your CBB Account)

Warning: Insert the following code into the designated script area inside your Webchat Editor.

<script src="https://app.chatgptbuilder.io/webchat/plugin.js"></script>   <script>   ktt10.setup({   pageId: "YOUR-ACCOUNT-ID",   icon: "YOUR_IMAGE_URL" }); </script>

Replace "YOUR_IMAGE_URL" with the URL of your desired image.


Open the Webchat after a Defined Time (timeout):

Simply substitute YOUR_WEBCHAT_ID with your unique webchat ID, and YOUR_ACCOUNT_ID with your account ID. This ensures that your webchat will automatically open after 3 seconds, using the correct identifiers for seamless integration.


Example code:


<script src="https://app.chatgptbuilder.io/webchat/plugin.js"></script> <script> ktt10.setup({ id: "YOUR_WEBCHAT_ID",  // This is your webchat ID accountId: "YOUR_ACCOUNT_ID",  // This is your account ID color: "#36D6B5" }); setTimeout(function() { ktt10Btn.click(); }, 3000);  // Automatically open after 3 seconds </script>


Free Templates:

Access a collection of free templates here.



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article