Hiding the department dropdown for advanced AI agents with Zendesk Chat (Legacy)

What's my plan?

Add-on | AI agents - Advanced

Configuring chat channels for advanced AI agents is no longer recommended. Instead, consider configuring messaging channels or configuring email channels.

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:

About hiding departments

Hiding the department dropdown menu

Related articles:

Configuring components in Web Widget (Classic)

Advanced customization of Web Widget (Classic)

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

Adding the snippet to your website or help center

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

Note: This section assumes you've already added Web Widget (Classic) 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.