Adding URL direction to departments
AnsweredIs it possible to have the option to filter url's to determine what department the customer goes to without having to get the customer to choose.
e.g any url containing /holidays would only send chats to anyone in the holidays department and if no one is there then it would stay offline or invisible depending on the settings. Other departments would be based on urls containing /hotels, /flights etc etc etc.
The idea is to have the option to only have the chat active depending on the url location within the site. That way the user can only chat depending on what department(s) is open at any time.
I hope this makes sense or indeed if it can already be done please 'show me the way'. Any help / solutions etc would be greatly appreciated.
-
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
-
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
-
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
-
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
Please sign in to leave a comment.
4 Comments