What's my plan?
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:

  • 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:

 

Chat widget

 

Chat widget 2

Hiding the department dropdown menu

You can hide the department dropdown menu by performing the following tasks:

  1. Editing the snippet
  2. 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.

Powered by Zendesk