Add-on | AI agents - Advanced |
In Web Widget (Classic), you can hide the department dropdown menu. This article walks you through the steps to do so and provides the necessary script snippet.
This article contains the following topics:
Related articles:
About hiding departments
Hiding the departments means end users don't see the dropdown menu in the pre-chat form. This prevents them from selecting between an AI agent or human department.
The screenshots below show what it looks like with and without the department dropdown.
With department dropdown: |
Without department dropdown: |
|
|
Hiding the department dropdown menu
You can hide the department dropdown menu by performing the following tasks:
Editing the snippet
Edit the Web Widget (Classic) snippet below by replacing BOT_DEPARTMENT and HUMAN_DEPARTMENT with the names of your departments or groups in Zendesk Chat or Support.
When the AI agent is online, the AI agent department will be selected. When the AI agent is offline, the human department will be selected.
<script>
zE('webWidget:on', 'chat:departmentStatus', function(dept) {
if (dept.name === 'BOT_DEPARTMENT' && dept.status === 'online') {
zE('webWidget', 'updateSettings', {
webWidget: {
chat: {
departments: {
enabled: [''],
select: 'BOT_DEPARTMENT'
},
}
}
});
} else if (dept.name === 'BOT_DEPARTMENT' && dept.status !== 'online') {
zE('webWidget', 'updateSettings', {
webWidget: {
chat: {
departments: {
enabled: [''],
select: 'HUMAN_DEPARTMENT'
},
}
}
});
}
});
</script>
Adding the snippet to your website or help center
Insert the snippet immediately below the Web Widget (Classic) snippet in your website or help center:
- Website: If you're not sure where the Web Widget (Classic) snippet is, contact your website developer.
- Help center: The Web Widget (Classic) snippet is located in the Document head (document_head.hbs) template. For help, see Customizing page templates and custom pages with HTML and Curlybars.
1 comment
Chloe Lee
Hi - my current script snippet looks different from yours. Here is my widget script. How should I edit it so it won't show the department dropdown?
<!-- Start of newbalanceau Zendesk Widget script -->
<script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=xxxxxxx-xxxxx-xxxxx-xxxxx-xxxxxxxx"> </script>
<!-- End of newbalanceau Zendesk Widget script -->
0
Sign in to leave a comment.