Installing the DialOnce script

This script is a piece of JavaScript required to be added in your web pages.

Beforehand, be assure to have an INTEGRATION KEY provided by your Customer Success Manager (CSM).

On the pages of your website where the widget must be integrated, you must have an HTML ID or HTML class on tags if you want the widget to be opened when clicking on them. Please provide these informations to your CSM.

Usage

This script must be integrated to your tag manager or manually on each page that requires the widget to be displayed.

<aside> 💡 The integrationKey is a token for accessing our API. It will be provided by your CSM.

</aside>

<script type="text/javascript">
var _dialonce = _dialonce || {};
_dialonce.integrationKey = "integration-key-here";
(function() {
  var dialonce = document.createElement("script");
  dialonce.id = "dialonce-sdk";
  dialonce.type = "text/javascript";
  dialonce.async = true;
  dialonce.src = "<https://cdn.dial-once.com/integrations-widget-widget/assets/auto.js>";
  var script = document.getElementsByTagName("script")[0];
  script.parentNode.insertBefore(dialonce, script);
})();
</script>

Debug informations

When the DialOnce script is launched on your page, it automatically seeks the ID and classes on your tags for injecting its anchors. If it doesn’t neither the ID or the classes, it will display a warning log in your browser console:

Page doesn't contains selectors: id: DIALONCE_Avant_Vente and/or class: null
Page doesn't contains selectors: id: DIALONCE_Suivi_commande and/or class: null

SPA special case

For Single Page Applications, it is required to re-launch the preceding script on each router changes where the HTML tags used for anchoring rely. Indeed, re-executing the script ensures the link between your triggering tags and the script.

We recommend uses of custom components which will allow that the script will get executed when your component will be executed in the DOM (or the V-DOM).

Analysis of the weight of the Widget on your site

When initializing the DialOnce script, it will perform the following 3 requests: