Show pageOld revisionsBacklinksExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Zendesk ====== To use zendesk widget add this code to the custom script section: <code> // ZENDESK WIDGET START window.zESettings = { webWidget: { offset: { horizontal: '1px', vertical: '1x', mobile: { horizontal: '-8px', vertical: '50px' } } } }; var head = document.getElementsByTagName('head')[0]; script = document.createElement('script'); script.src = '<ZENDESK_SCRIPT_URL_WITH_KEY>'; script.id = 'ze-snippet'; head.appendChild(script) // ZENDESK WIDGET END </code> To make it work for your case, insert zendesk script url with key, and change this line only: <code> script.src = '<ZENDESK_SCRIPT_URL_WITH_KEY>'; </code> To change placement of widget, change these settings: <code> window.zESettings = { webWidget: { offset: { horizontal: '1px', vertical: '1x', mobile: { horizontal: '-8px', vertical: '50px' } } } }; </code> To hide zendesk chat widget in certain game(in this case `evolution`), add such snippet below: <code> // ZENDESK HIDE FOR EVOLUTION START document.addEventListener("routeChange", routeChangeEvent => { if (routeChangeEvent.detail.moduleName === 'evolution') { waitzE(function() { zE('webWidget', 'hide')}); } else { waitzE(function() { zE('webWidget', 'show')}); } }); function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } async function waitzE(cb) { while(typeof zE !== "function") { await sleep(1000); } cb(); } // ZENDESK HIDE FOR EVOLUTION END </code> admin/online-platform-cms/3rd-party-scripts/zendesk.txt Last modified: 2022/03/31 14:13by algirdas-matas