Why is the offline form settings ignored if one department is on when another is off?
답변함Situation:
I have three departments and three schedules. They have similar hours, but occasionally a site may suffer power outage or weather related issues. So I adjust the schedule of the affected department so that people don't submit a bunch of chats. I have the missed chat form disabled in Zendesk Chat as well so my agents don't get overwhelmed during our busiest season.
yet people still can submit chats to the missed chat form, despite it being turned off. I spoke to support about this and the answer is because I have other departments that are online?
How does that make sense? I have the missed chat form turned off for everyone. This is bonkers.
Also, occasionally I can get chats submitted from a customer and the URL field is completely blank. How is that possible?
Feature list I'd love btw: Since I use multiple widgets (one for each brand) I'd love if someone is served a chat from a widget that I can restrict the available departments based on that branded widget without additional code.
Further- why do I have operating hours in Support but I have to go into a different scheduling tool for Zendesk chat?
-
Hi Kelsey,
I feel you! I think you can attend to this based on this article (and awesome comments): https://support.zendesk.com/hc/en-us/articles/360022192234
I'm not much of a coder so my skin crawls when something is not native to the software, but in this case it does look pretty straightforward. I hope this helps to some degree.
Side note - when you update hours I can envision that depending on the cache settings on the user's machine, it's possible the widget would misbehave until the end user clears cache or something.
-
Hi Kelsey,
There are multiple things at play here.
I believe one of the things that is being overlooked is that you need some additional javascript for the widget.
This code should check whether a department is still online, and if not, it will hide the widget.
If you don't add this code, it means customer who already loaded your site/zendesk widget will get the offline form.
This happens since you were online when they loaded, but went offline (in one or more departments) when they were idle or browsing your website.
If I understand it correctly, can you please share your department names? To see if I can get you in the right direction with some sample code. -
Sure, my departments are
- SetA
- SetAA
- SetI
- SetD
I'm not certain this is the case because on Tuesday we had a site go down and people were able to submit missed chats throughout the outage.
-
⚠️Fair warning: no guarantees on this code
Here's how it works in a nutshell.
- Chat is hidden on page load by default
- All departments are checked
- Visitor department is set based on url
- Chat is toggled if the visitor's department is online
- Every 10 seconds this process is repeated
var all_departments;
var department;
var $custom_button_chat = $('.help-widget .chat');
// map url to chat departments
var url_path = window.location();
var mapping = {
'https://website.com/SetA' : 'SetA',
'https://website.com/SetAA': 'SetAA',
'https://website.com/SetI' : 'SetI',
'https://website.com/SetD' : 'SetD',
};
autoControlDepartment = function controlDepartmentDropdown(){
// remove dropdown from chat
$zopim.livechat.departments.filter('');
// set the correct visitor department
$zopim.livechat.departments.setVisitorDepartment(department[0].name);
}
checkDepartmentStatus = function departmentStatus(){
zE(function() {
$zopim(function() {
all_departments = $zopim.livechat.departments.getAllDepartments();
department = all_departments.filter(function (department) {
return department.name.toLowerCase() == mapping[url_path.toLowerCase();
});
});
});
}
toggleChatButton = function chatButton(){
if ( (!department) || ( department[0].status === "offline" || department[0].status === "away" )) {
zE.hide();
} else {
zE.show();
}
}
zE(function() {
$zopim(function() {
$zopim.livechat.hideAll();
$zopim.livechat.setOnConnected(function() {
// get all departments
checkDepartmentStatus();
autoControlDepartment();
// hide the chat button if we are offline or away
toggleChatButton();
// re-check status of department every 10 seconds and toggle the custom chat button
window.setInterval(checkDepartmentStatus, 10000);
window.setInterval(toggleChatButton, 10000);
});
});
zE.hide();
});
댓글을 남기려면 로그인하세요.
4 댓글