Make chat widget available for certain ORG tags | Community
Skip to main content

Make chat widget available for certain ORG tags

  • July 30, 2018
  • 5 replies
  • 0 views

Hi! I want to have chat available only for users belonging to an organization with a certain tag.

I was able to hide the "submit a request" button like that using this article :

 https://support.zendesk.com/hc/en-us/articles/203661076-Hide-and-show-My-Activities-and-Submit-a-Request-Help-Center-

 but i'm having trouble locating the elements that need to be hidden for the chat widget not to appear. It seems that a different method is needed.

 

Would appreciate any help!

This topic has been closed for replies.

5 replies

Here's a script that you can use on your website to show the widget on selected customers only

<script type="text/javascript">

if(HelpCenter.user.tags.indexOf('vip_chat') > -1)
{ //Checks to see if a certain tag is associated with the logged-in user
console.log('I have the tag');
window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s= d.createElement(s),e=d.getElementsByTagName(s)[0];
z.set=function(o){z.set. _.push(o)};
z._=[];z.set._=[];
$.async=!0;$.setAttribute('charset','utf-8');
$.src='//v2.zopim.com/?ACCOUNTKEY';
z.t=+new Date;
$. type='text/javascript';
e.parentNode.insertBefore($,e)
})(document,'script');
}

</script>


Jacob20
  • August 2, 2018

Hi David,

If you want to simply suppress the chat feature of the web widget, but leave other options available (if you have them), you could use the following:

<script type="text/JavaScript">
window.zESettings = {
webWidget: {
chat: {
suppress: true
},
}
};
</script>

If you want to hide the whole widget you can do that too:

<script>
  zE(function() {
    zE.hide();
  });
</script>

If you're using the chat widget (not the web widget) you can hide that too, like this:

<script>

$zopim(function() {
$zopim.livechat.button.hide();
});

</script>

I haven't included the conditions for suppressing/hiding the elements because you appear to have that part covered (also I wouldn't know where to begin with that ;))

Hope that helps you out.


  • Author
  • August 2, 2018

Thanks for the suggestion Jacob!


  • May 24, 2019

Hello @fernando,

Is it possible to include multiple user tags?  Maybe switch out 'if' with a Case?  We're trying to show our chat only to users within certain countries (users are tagged with country code).  Will your example still work?  Or would I need to duplicate this for each tag?

Also, the Account Key, is that a token or our account domain?

Thank you,

Amanda


Brett13
  • Community Manager
  • June 3, 2019

Hey Amanda,

It looks like you have a ticket open with our Solutions Consultants team regarding this. If you don't get any assistance here from the community we will continue working with you in the ticket :)

Cheers!