How to auto assign a department
When a user clicks your live chat button, What department should they see.
If you have departments enabled, you may want the user to already have a certain department selected when they launch a new live chat window.
By default, the system will auto select the first department in the list / the first chat department you created. This behaviour can be modified by adding some custom code to your live chat widget.
Typically, You will have some code similar to this on your website:
This would allow the user to start a live chat and then choose a department. However the default department will be whatever the system has chosen.
If you wanted to set your department for this particular page for example. Say you have a webpage dedicated to Plumbing and you want chats on this page to by default go to the Plumbing department (or at least have it selected by default) , you would change the code above to something like below:
the modifications we made above are as follows:
We also now give it a 3rd parameter. This time its the name of the department (as displayed within the Department settings window within live chat)
In this case it now reads :