Hello,
Maybe to start with what is not possibe:
- you cannot remove/change the "Powered By Genesys" at the bottom of the webchat window
- you cannot change the Chat icon (next to Live Chat) at the top of the window
What is possible is to:
A) Changing label values - Example with the "Live Chat" text in WebChat window.
First, let's the find the key/reference of that label in https://all.docs.genesys.com/WID/Current/SDK/WebChat-combined#Default_i18n_JSON
The key for this label is "ChatTitle".
Note that "Live Chat" also appear in other "labels" used for Web Content Accessibility Guidelines (WCAG) 2.1, Level AA.
- "AriaWindowLabel": "Live Chat Window",
- "AriaMinimize": "Live Chat Minimize",
- "AriaMaximize": "Live Chat Maximize",
- "AriaClose": "Live Chat Close",
Info on Accessibility: https://all.docs.genesys.com/WID/Current/Developer/Accessibility
When we set the widgets configuration, we can override the label values the following way (let's say for US English):
window._genesys.widgets.main.i18n = {
"en": {
"webchat": {
"ChatTitle": "CompanyXYZ Chat",
"AriaWindowLabel": "CompanyXYZ Chat Window",
"AriaMinimize": "CompanyXYZ Chat Minimize",
"AriaMaximize": "CompanyXYZ Chat Maximize",
"AriaClose": "CompanyXYZ Chat Close"
}
}
};
B) Changing the css theme
There are 2 natives themes: "dark" and "light" modes.
You can add your own theme to change colors for text/background....
Let's say I want to add a new theme that I will name "mybrand" (this is just the keyname of the theme).
For the css class name, I will use "cx-theme-mybrand".
What I need to do is:
- create a new css file that will store the colors/fonts/... I want for this theme
- import this new css in my web page
- configure the Widgets to use this new theme.
a)
In order to create your new css, you can start from the 2 samples provided in this page: https://all.docs.genesys.com/WID/Current/Developer/GWCCustomize
theme-template-dark.less or theme-template-light.less
(download links provided in the page)
I will download the "theme-template-dark.less".
I first need to convert it to a css format (from less).
You can find online webtool to do this. I have used this one: https://jsonformatter.org/less-to-css
Now, take the css and copy it into a file - ex: mybrand_custom.css
As we started from theme-template-dark.less, we need to replace the "cx-theme-dark" with the name we have chosen for our own theme: "cx-theme-mybrand".
You can modify colors in this css based on your needs.
You can also add additional style properties which will apply to the containers referenced in the css.
Ex for the window title:
.cx-widget.cx-theme-mybrand .cx-titlebar .cx-title {
color: #FDFDFD;
}
b)
In your html page, you need to reference this new css file (ex: mybrand_custom.css).
Before importing the scripts to load the widgets libraries and configuration, just add a link element.
This is what I have in my html page:
<link rel="stylesheet" href="mybrand_custom.css">
<script src="https://apps.mypurecloud.com/widgets/9.0/cxbus.min.js" onload="javascript:CXBus.configure({debug:true,pluginsPath:'https://apps.mypurecloud.com/widgets/9.0/plugins/'});CXBus.loadFile('pc_config.js').done(function(){CXBus.loadPlugin('widgets-core');});"></script>
Note 1: in my case, "mybrand_custom.css" is located at the same level than the html file.
Note 2: the "pc_config.js" I am referencing in the script element is where I set the widgets configuration and configuration. This is not mandatory to follow this approach. I just prefer to separate the html page/code from what relates to the widgets configuration and customization. The "pc_config.js" is also located at the same level than the html in my example (you can change this to a relative path or full url path if you prefer to store somewhere else).
c)
In my widgets configuration (initialization), I now need to tell the widgets to use that new theme (which is using a class name = "cx-theme-mybrand")
I just need to set the following (in my case, it is done in the pc_config.js).
window._genesys.widgets.main.theme = "mybrand";
window._genesys.widgets.main.themes = {
"mybrand": "cx-theme-mybrand"
};
d)
Coming back to the css - the cx-theme-dark, cx-theme-light or the cx-theme-mybrand you generated from one of the following native template will change the colors/... for all windows from Genesys Widgets (not just WebChat).
If you want to change the colors/fonts of one specific widget (Ex: WebChat) and apply a different set of colors/fonts to another widget (ex: SideBar), or if you want to change the color of a specific element in the widget, you can follow what is described in "Change the appearance of a specific widget" in this page: https://all.docs.genesys.com/WID/Current/Developer/GWCCustomize
In order to do that, you will have to specify the class name specific to the widget you want to change. Ex: cx-webchat for the WebChat window.
Or for the form inputs of the WebChat window only (and have other widgets use a different color): .cx-webchat .form input
If you want to use a different font (than the one used by Genesys Widgets), you can add something like this in your custom css:
.cx-widget{ font-family: name-of-font-here; }
Now, let's say I want to change the Title bar, setting a background-image with a different background-color.
In my css, I would add (as it is not present for this one specifically)
.cx-widget.cx-theme-mybrand .cx-titlebar {
background-color: rgb(142, 192, 248);
background-image: url("mybackground.png");
}
If I want to set this background image and color only for the WebChat widget, I would use:
.cx-widget.cx-theme-mybrand .cx-webchat .cx-titlebar {
background-color: rgb(142, 192, 248);
background-image: url("mybackground.png");
}
C) Collect different inputs in the Chat Registration Form
If you wish to collect additional information during the Chat Registration Form, you can define these via widgets configuration.
When you define new inputs, they will be automatically extracted and sent in the initial Chat Request (they will be added with keyname equal to what you have defined in the name property)).
See here for a basic example: https://all.docs.genesys.com/WID/Current/SDK/WebChat-combined#Default_example
Hope this clarifies.
Regards,