Installation

Basic Javascript

If you have a website with many pages and a new page refresh every time someone clicks on it, then you will need to use basic JavaScript method. You won't need to create separate actions that trigger when the Assistant appears or updates. Instead, the page refresh itself will trigger the action. To set up basic JavaScript, just follow these steps:

How to Install

To get the Assistant to appear on your web app simply copy and paste the snippet below before the </body> tag on every page where you want the Assistant to appear for website visitors.

//Set your APP_ID
var ASSISTANT_ID = "ASSISTANT_ID";
!function(t,e,n){function s(){
    const t=e.getElementsByTagName("script")[0],n=e.createElement("script");
    n.type="text/javascript",n.async=!0,n.src="https://assistant.thrivedesk.io/bootloader.js?"+Date.now(),
    t.parentNode.insertBefore(n,t)}if(t.Assistant=n=function(e,n,s){t.Assistant.readyQueue.push({method:e,options:n,data:s})},
    n.readyQueue=[],"complete"===e.readyState)return s();
  t.attachEvent?t.attachEvent("onload",s):t.addEventListener("load",s,!1)}
  (window,document,window.Assistant||function(){}),window.Assistant("init", ASSISTANT_ID);

Copy the ASSISTANT_ID from ThriveDesk application > Assistant.

Last updated