Recent searches


No recent searches

Can I restrict Chat support to a specific group of users on the help center?



Edited Mar 29, 2023


0

7

7 comments

Would it be possible for the web widget be available to all users for answer bot, but chat not be an option for either visitors (non-signed in users) or organizations with a specific tag (such as VIP/Non-VIP/Trial/Premium/etc.) ?

0


image avatar

Blanca

Zendesk Customer Care

Hi David,

Thank you for reaching out. I am sorry that at the moment, there is no functionality to have the answer bot available to all end-users while the chat widget to be restricted to a specific organization/user with certain tags. With the thread above, I hope that you can find something close to your use case though.

Cheers,
Blanca

0


Hello! 

Does anyone have an example of the js if you would like to suppress the chat widget based on organization tags? For example, we only want users that belong to organizations with the tag "customer" to see the chat widget. 

Here is where I am currently at and it is not working:

  for (var c in HelpCenter.user.organizations) {
if (HelpCenter.user.organizations[c].tags !== "customer"){
     zE('webWidget', 'updateSettings', {
      webWidget: {
        chat: {
            suppress: true
      },

0


image avatar

Greg Katechis

Zendesk Developer Advocacy

Hi Laura, couple questions:

  • Are you looking to hide the widget entirely or suppress the chat option, but keep other options?
  • When you say this isn't working, could you let me know what debugging you've done to determine at what point in the function it isn't working?

0


Hi Greg, 

I would like to hide the widget entirely. Below the lines I shared above, I have the other suppress options as well for contactForm, helpCenter, talk, and answerBot. 

Currently, I am testing this change on an inactive theme to ensure it works. When I am previewing that theme I can still see the widget when switched to anonymous. My thought for this was if the user was anonymous then they wouldn't have the organization tag to meet the requirements. 

As a test, I was able to have the widget hide based on the user role with the suppress feature. 

 

Thanks for the help!

Laura M

 

0


image avatar

Greg Katechis

Zendesk Developer Advocacy

Thanks for that info! Since you're looking to hide the widget altogether, the best way to start with this would be to hide it by default to start off with. This way you don't have to worry about execution delays that might briefly show the widget and then hide it after. To hide it entirely, you'll want to use this command.
 
With respect to the code snippet itself, you can do something like this:
 
for (var c in HelpCenter.user.organizations) {
if (HelpCenter.user.organizations[c].tags.includes("customer")){
zE('webWidget', 'show');}}

Since you're looking for a specific value in an array, you need to use some sort of array lookup tool. I chose includes, but there may be reasons to use other options. Let me know if you run into any issues with this!

0


This appears to be working. Thanks again for the help! 

0


Please sign in to leave a comment.