Integrating Genius Chat Widget

Integrating Genius Chat Widget

Integrating the Genius Chat Widget in to your website is easy. Firstly add the DG_CHAT_WIDGET_CONFIG object as provided by your Customer Success Manager to the bottom of each page you want the widget to appear on, just before the closing body tag:

<script>
  window.DG_CHAT_WIDGET_CONFIG = {
     widgetId: '22df40c4-110f-4b6f-aa2b-aeaffd6d1179',
     env: 'eu|us'
  }
</script>
</body>

Next, include a reference to the Genius Chat Init script and initialise the widget by calling the window.dgchat.init() method.

<script src="https://chat.digitalgenius.com/init.js"></script>
<script>window.dgchat.init()</script>

That's it! The chat widget will appear as configured on your webpage.

Versioning

Genius Chat is versionless. Once you have embedded chat you will always have access to the latest stable features without the need to make any updates to your code.

⚠️

We recommend against using Tag Management Systems (TMS) such as Google Tag Manager to embed chat in to your page. Ad blockers are known to block scripts injected via TMS.

If you are using server side tagging for GTM or another solution which circumvents problems with ad blockers this may not be an issue. In this case we recommend that you test that the widget is not blocked by popular blockers such as Ublock Origin once it is deployed.

⚠️

Content Security Policy

If your website implements a Content Security Policy (CSP) then you need to whitelist the following origins in the policy:

  • chat.digitalgenius.com
  • *.dgdeepai.com

If you are using Sunco (Zendesk) as your helpdesk you will also need to whitelist:

  • *.smooch.io