To embed the Ask Extension chatbot into your website, you must minimally include the following in your HTML:
<!-- Begin Ask Extension Widget embed code -->
<div id="ae-chatbot-widget" style=""></div>
<script src="https://chat.ask.eduworks.com/static/js/widget-loader.js"></script>
<!-- End Ask Extension Widget embed code -->
To style the chatbot to match your site’s theme you can pass custom CSS styles. All of these settings are optional, but each one will override part of the default look and feel. All of
the settings must be added inside the style=""
property, each separated by a semi-colon.
At minimum, set the --chatbot-brand-primary-color
to your theme’s main color. This can be a hex color, rbg, or other standard CSS color value. For example:
<!-- Begin Ask Extension Widget embed code -->
<div id="ae-chatbot-widget" style="--chatbot-brand-primary-color: #f0721f;"></div>
<script src="https://chat.ask.eduworks.com/static/js/widget-loader.js"></script>
<!-- End Ask Extension Widget embed code -->
#22499c
The following styles apply to the chatbot icon that appears in the corner of the screen.
--chatbot-icon-background-color
will show through. Any common image format should work but .PNG or .SVG are recommended. For example:
url(https://example.com/chatbotAvatar.png)
#22499c
50px
0
. Any value greater than 50% or the
--chatbot-icon-size
value will be a circle. To round each corner separately you can pass 2 or 4 values. For example 0 50%
or 0 10px 20px 5px
none
. To apply a border use the CSS border syntax, for example
3px solid orange
or 1px dashed #22499c
none
. Use CSS box-shadow syntax, for example
-2px 4px 2px rgba(0, 0, 0, 0.2)
1rem
but this can be any value such as px, %, em, ch, vw,
etc.
#22499c
or
var(--chatbot-brand-primary-color)
none
. To apply a border use the CSS border syntax, for
example 3px solid #000
or 1px dashed #22499c
none
to hide this. The default is -2px 4px 2px rgba(0, 0, 0, 0.2)
The following styles apply to the open chatbot window and its contents.
30rem
50px
. This can be any value: px, %, rem, vw, etc.
The default is
0
0
3px solid orange
or
1px dashed var(--chatbot-brand-primary-color)
. The default is none
white
none
for no shadow. The default is -2px 4px 8px rgba(0, 0, 0, 0.1)
4px
1rem
black
hsl(0, 0%, 96%)
white
var(--chatbot-brand-primary-color)
Example of a restyled chatbot:
<!-- Begin Ask Extension Widget embed code -->
<div id="ae-chatbot-widget" style="
--chatbot-brand-primary-color: orange;
--chatbot-modal-margin: 2rem;
--chatbot-modal-radius: 8px;
--chatbot-modal-border: 3px solid orange;
"></div>
<script src="http://localhost:8081/static/js/widget-loader.js"></script>
<!-- End Ask Extension Widget embed code -->
To modify the chatbot's behavior for your integration, you need to also define a constant called "ae_widget_config_params". This allows you to filter by state and, in the future, institution.
<!-- Begin Ask Extension Widget embed code -->
<div id="ae-chatbot-widget" style=""></div>
<script>
// The following const definition is optional, but allows you to configure the chatbot.
// If any settings are not provided, default values will be used.
const ae_widget_config_params = {
list_of_states: ["Texas", "Oklahoma", "Kansas", "Arkansas", "Missouri"],
state_downweight: 0.9,
source: "oklahoma state",
source_downweight: 0.9,
extension_office_url: "https://extension.okstate.edu/county/",
state: "Oklahoma",
}
</script>
<script src="https://chat.ask.eduworks.com/static/js/widget-loader.js"></script>
<!-- End Ask Extension Widget embed code -->
About the configuration parameters