Skip to content
Browse the docs

Install

Install ASDK with HTML

Add the ASDK widget to any website whose HTML you can edit: paste one script tag before the closing body tag of every page, publish, then check it.

Last updated

On this page

Use this guide when you can edit your site's HTML directly or through a template: a hand-written site, a static site generator, or a CMS with a footer template.

Add the snippet

Copy your snippet

On the ASDK dashboard's Install page, copy the snippet. It looks like this, with your own site ID:

HTML
<script async src="https://cdn.asdk.com/v1/asdk.js" data-site-id="SITE_ID"></script>

Paste it before the closing body tag

Paste the snippet just before </body> on every page. If your site uses a shared footer, layout or template file, paste it there once and every page gets it.

HTML
    <footer>…</footer>
    <script async src="https://cdn.asdk.com/v1/asdk.js" data-site-id="SITE_ID"></script>
  </body>
</html>

The snippet also works in the <head>. Paste it only once per page: a second copy is ignored, but it costs a request.

Publish and check

Upload or deploy the change, open your site and look for the chat button in the bottom corner. Then click Check installation on the dashboard's Install page.

Options

You can set these attributes on the script tag; everything else comes from the dashboard.

AttributeValuesWhat it does
data-site-idyour site IDRequired. Connects the widget to your site's settings and knowledge.
data-positionright, leftOverrides the position set in the dashboard on this page.
data-localea language code such as de or pt-BROverrides the language, which is otherwise taken from the page and the browser.
data-opentrueOpens the chat when the page loads. A visitor who closed it is not overruled.

Calling the widget from your own code

Your scripts can open the chat or pass who is signed in. Calls made before the widget has loaded are kept and run once it loads, if you add this line before the snippet:

HTML
<script>
  window.asdk = window.asdk || function () { (asdk.q = asdk.q || []).push(arguments); };
</script>

Then, for example, asdk("open") opens the chat from a "Talk to us" button.

If something doesn't work, see troubleshooting.