Adding URL direction to departments

Respondida

4 Comentarios

  • Ramin Shokrizadeh
    Zendesk Product Manager

    Hi there Malcolm,

    Thanks for the question. There are technically two ways you could accomplish this either by using a trigger or using the Javascript APIs.

    You can create a trigger to set the visitor department based on the URL path they are on. It can look like this:

    The downside of this approach is they could technically switch the department from the dropdown to something else (ex. from 'Holidays' to 'Flights')

    The 2nd approach (that I would recommend), is use the Javascript API to set the department based on the page and then hide the department dropdown so they cannot switch the department to something else.

    You will need to use the setVisitorDepartment API and the filter('') API to remove the dropdown. Here are the docs for reference: https://api.zopim.com/files/meshim/widget/controllers/liveChatAPI/Departments-js.html

    Thanks,

    Ramin

    0
  • Malcolm Bruce

    Hi Ramin,

    Thanks for your answer which was helpful, however as I push the boundaries at little further is it possible to then only show the chat button/form on a department only when there is an agent from that specific department online.

    As it currently stands when any agent logs in to any department the chat button becomes live across all departments and my aim here is to limit this to only show on departments when staff are free to chat in their specialist field.

    I can always resort to having individual accounts for each department but I was just trying to see the possibilities to having control in a single account.

    Again I appreciate the time you have taken to answer my query.

    Best regards

    Malcolm

    0
  • Ramin Shokrizadeh
    Zendesk Product Manager

    Hi Malcolm,

    It can be done but will require some custom code using the Javascript API.

    By using the getAllDepartments API, you will know the status of the department: https://api.zopim.com/files/meshim/widget/controllers/liveChatAPI/Departments-js.html#$zopim.livechat.departments.getAllDepartments

    Based on the status of the department that you are setting for that particular page path, you can then set the status of the widget to online/offline using https://api.zopim.com/files/meshim/widget/controllers/LiveChatAPI-js.html#setStatus

    -Ramin

    0
  • Malcolm Bruce

    Hi Ramin,

    Thanks for the information. I'll get one of my developers on the case and get this sorted (hopefully)

    Thanks for your guidance, much appreciated.

    Regards

    Malcolm

    0

Iniciar sesión para dejar un comentario.

Tecnología de Zendesk