The DialOnce script is a block of JavaScript code that needs to be added to the pages where the click-to-hub is to be added.
First, please make sure you have the authentication TOKEN that your Customer Success Manager provided you.
On the pages where the widget will be displayed, an HTML ID must be added to each element that will act as a trigger. You can then send the IDs to your CSM.
The script must be integrated into your tag manager or manually on all your website pages where you want to display the widget.
<aside> 💡 The IntegrationKey is an access token to our API. It will be sent to you by your Customer Success Manager.
</aside>
JavaScript
<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>
For Single Page Applications, it is necessary that the previous script be executed on each change of the router where the HTML tag on which the widget is called is located. When the script is executed, the link between the HTML tag and the script is made.
We recommend the use of custom components that will allow the script to run when the component is executed in the DOM (or V-DOM).
When initializing the DialOnce script, the following queries will be executed: