Ada Chat Bot
How to Install
- Go to Portal’s Control Panel, Tags Manager;
- Click “Create Tag” and select “Custom JS”;
- Give it a name (e.g. “Ada”), give a description;
- Assign a “On App Init” condition to this tag
- Insert the following contents of the Tag:
(async () => {
function init() {
async function onScriptLoad() {
const response = await Playtech.API.server.getJWTToken();
window.adaSettings = {
sensitiveMetaFields: {
jwt_token: response?.data?.jwtToken ?? '',
},
zdChatterAuthCallback: (callback) => {
(async () => {
const response = await Playtech.API.server.getJWTToken();
callback(response?.data?.jwtToken ?? '');
})();
}
};
}
const script = document.createElement('script');
script.id = '__ada';
script.type = 'text/javascript';
script.onload = onScriptLoad;
script.async = true;
script.setAttribute('data-handle', '<YOUR HANDLE>');
script.src = 'https://static.ada.support/embed2.js';
document.getElementsByTagName('head')[0].appendChild(script);
}
if (Playtech.API.auth.isLoggedIn) {
init();
}
Playtech.on(Playtech.Events.LOGGED_IN, init);
Playtech.on(Playtech.Events.LOGGED_OUT, function () {
window.adaEmbed?.reset();
});
})();