Question

Is it possible to completely hide the department field called Choose a department on the pre-chat form?

Answer

Note: The pre-chat form is a feature of live chat and does not have an equivalent in messaging. For more information on messaging, see the article: About messaging. 

There is no native setting that will remove the department field entirely. In your pre-chat form settings, unchecking Require Department doesn't remove the field from the pre-chat form but it will make it optional. 

2022-10-20_14-23-43.png

However, you can hide the department field from visitors by using the Departments API end-point with an empty array.

<script type="text/javascript">
  window.zESettings = {
    webWidget: {
      chat: {
        departments: {
          enabled: []
        }
      }
    }
  };
</script>

Simply add the above code after your widget script on your website. It will look something like this: 

<script id="ze-snippet" src=[your widget key here]> </script>
<script type="text/javascript">
window.zESettings = {
webWidget: {
chat: {
departments: {
enabled: []
}
}
}
};
</script>

This code prevents any visitors from seeing the department dropdown and therefore from selecting a department. It does not remove the department functionality from the chat entirely. You can still assign a department to a chat request on the back end using a trigger or the departments.select function.

Disclaimer: This article is provided for instructional purposes only. Zendesk does not support or guarantee the code. Post any issues you have in the comments section or try searching for a solution online.

For more information, see this article: Automatically route chats to departments.

Powered by Zendesk
OSZAR »