Hiding the Chat widget on mobile devices Follow

Comments

5 comments

  • Avatar
    Jeff Parker
    Doesn't work for me.
  • Avatar
    Andrew Mills

    Not working. Using as below.

    `<script type="text/javascript">
    var ua = navigator.userAgent.toLowerCase(), platform = navigator.platform.toLowerCase();
    platformName = ua.match(/ip(?:ad|od|hone)/) ? 'ios' : (ua.match(/(?:webos|android)/) || platform.match(/mac|win|linux/) || ['other'])[0],
    isMobile = /ios|android|webos/.test(platformName);
    if (!isMobile) {
    id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=e87=my-key=4e"
    }
    </script>`

  • Avatar
    Peter Vandendriesse

    Can we get an update on this?  The suggested fix doesnt seem to take into account the usual embed code (Andrew Mills' response here shows the incorrect fix if the instructions are followed exactly ) 

  • Avatar
    Charles Nadeau

    Please note that this article applies to Chat-only accounts. There are two main types of Chat accounts:

    • Chat-only offers Zendesk Chat communication with your customers, and nothing else.
    • Chat + Support combines Zendesk Chat with a Zendesk Support account, which allows you to share data and functionality between the two products.

    See About Chat account types in the Chat Help Center.

    The embed code varies between the two. The Chat-only embed code looks as follows:

    <script>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="https://v2.zopim.com/?2LOuzDNZKZgAjXUrtRuXlGJ0Iiwx4A6t";z.t=+new Date;$.
    type="text/javascript";e.parentNode.insertBefore($,e)})(document,"script");</script>

    The Chat+Support embed code looks like Andrew's snippet above:

    <script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=e87=my-key=4e"></script>

    I'll update the introduction to make this clearer.

  • Avatar
    Peter Vandendriesse

    Ah, thanks Charles, that makes sense! 

    So how can we hide the widget on mobile if we have a Chat+Support account?

Please sign in to leave a comment.

Powered by Zendesk