# Zendesk

## Как объединить виджет Blinger c онлайн-чатом Zendesk?

![](/files/-LbSemnn1soeQJucZt5v)

## Шаг 1. Поместить следующий код перед закрывающимся тегом `</body>`:

```markup
<!-- Zendesk widget source -->
<script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=[your_zendesk_key]"> </script>

<!-- Init and customize Freshchat widget -->
<script>
    window.zESettings = {
        webWidget: {
            offset: {
                horizontal: '100px'
            },
        },
    };

    zE('webWidget:on', 'close', function() {
        zE('webWidget', 'hide');
    });
</script>

<!-- Init and customize Blinger Widget -->
<script>
    var showBlinger = function () {
        if (typeof Blinger !== 'undefined' && !Blinger.launcherWidget.isOpen) {
            document.getElementById('blinger-launcher-iframe').style.display = 'block';
        }
    };

    window['blingerBeforeRender'] = function () {
        var channel = new Blinger.Channels.SimpleActionChannel();
        channel.tooltip = 'Livechat';
        channel.color = '#75b145';
        channel.imageUrl = 'https://app.blinger.io/images/widget2/livechat.png';
        channel.action = function () {
            zE('webWidget', 'show');
            zE('webWidget', 'open');
        };

        Blinger.channelsWidget.addChannel(channel);
        Blinger.channelsWidget.resizeEnabled = true;
    };

    window['blingerInit'] = function () {
        document.getElementById('blinger-launcher-iframe').style.display = 'none';
    };

    var count = 0;
    var waitForZEWidgetloading = function () {
        var zEwidgetDisplay = zE('webWidget:get', 'display');

        if (zEwidgetDisplay === 'launcher') {
            var element = document.getElementById("launcher");
            element.parentNode.removeChild(element);
            showBlinger();
        } else {
            if (count < 20) {
                setTimeout(function () {
                    waitForZEWidgetloading();
                }, 300);
                count++;
            }
        }
    };

    waitForZEWidgetloading();

    (function (d) {
        var s = d.createElement("script");
        s.async = true;
        s.charset = "utf-8";
        s.src = "https://app.blinger.io/uploads/widgets2/[Value].js";
        d.head.appendChild(s);
    })(window.document);
</script>
```

### Шаг 2. Вставить вместо `[your_zendesk_key]`токен виджета из личного кабинета Zendesk.

```markup
<script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key=[your_zendesk_key]"> </script>
```

{% hint style="info" %}
Токен виджета можно найти: **Admin > Widget > вкладка "Setup".** Значение токена располагается после "key="
{% endhint %}

### Шаг 3. Прописать в строке номер виджета на необходимый вместо `[Value]`

```markup
  s.src = "https://app.blinger.io/uploads/widgets2/[Value].js"
```

{% hint style="warning" %}
Номер необходимого виджета можно найти после значения "Виджет #", если зайти в собственный аккаунт администратора Blinger, перейти в раздел 'Widget"
{% endhint %}

{% hint style="info" %}

### Полезно

Цвет и подпись кнопки для онлайн-чата Zendesk можно задать при помощи параметров **`channel.tooltip = 'Онлайн чат'`** и **`channel.color = '#75b145'`** соответственно.
{% endhint %}

{% hint style="info" %}

## Не нашли ответа на свой вопрос?

Обратитесь в Службу поддержки Blinger
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.blinger.io/russian/faq-1/faq/po-kanalam/zendesk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
