So, I am trying to add a new script to the custom code in project settings. When I add the script I should see a small widget that floats on the bottom right of the screen. When clicked it brings up a live chat box (kayako).
The current iteration works… but their beta version does not. I have tried to add it after stripping away all the current custom code on the site… still does not work.
I have added it, via wordpress, to the blog that is integrated with the site here https://fxpig.com/blog, and it loads correctly.
Here is the code snippet;
<script type="text/javascript">!function(a,b){function c(){var b=a.createElement("iframe");return b.id="kayako-messenger-frame",b.style.border="none",b.style.width="100%",b.style.height="100%",b}function d(){var c=a.createElement("script");return c.async=!0,c.type="text/javascript",c.src=b._settings.messengerUrl,c}function e(){var b=a.createElement("div");return b.id="kayako-messenger",b.style.position="fixed",b.style.right=0,b.style.bottom=0,b.style.width=0,b.style.height=0,b}window.kayako=b,b.readyQueue=[],b.ready=function(a){b.readyQueue.push(a)},b._settings={messengerUrl:"https://fxpig.kayakocdn.com/messenger",apiUrl:"https://fxpig.kayako.com/api/v1",socketInstance:"fxpig.kayako.com",teamName:"FXPIG",homeTitle:"Hi... Need some Help",homeSubtitle:"Welcome to FXPIG. Let's chat - start a new conversation below.",widgets:{presence:{enabled:true},twitter:{enabled:true,twitterHandle:"134279494"},articles:{enabled:false,sectionId:undefined}},styles:{primaryColor:"#9557c1",homeBackground:"#9557c1",homePattern:"",homeTextColor:"#FFFFFF"}};var f=a.body.getElementsByTagName("script")[0],g=c(),h=e();f.parentNode.insertBefore(h,f),g.onload=function(a){a.target.loaded||(a.target.loaded=!0,g.contentWindow.document.body.appendChild(d()))},h.appendChild(g,f),g.contentWindow.document.open(),g.contentWindow.document.write("<!DOCTYPE html>"),g.contentWindow.document.write("<html>"),g.contentWindow.document.write("<head></head>"),g.contentWindow.document.write("<body></body>"),g.contentWindow.document.write("</html>"),g.contentWindow.document.close()}(document,window.kayako||{});</script>
I am trying to add this to https://fxpig.com. Currently, the site displays the non-beta widget, using this code;
<script type="text/javascript">!function(a,e){window.kayako=e,e.readyQueue=[],e._config={apiUrl:"https://fxpig.kayako.com/api/v1",cdnUrl:"https://fxpig.kayako.com/__apps/widget/assets/visitor",defaultName:"FXPIG",themeColor:"#9557c1",themeAvatar:"https://fxpig.com/images/genie-43.png",welcomeMessage: "How can we help? We’d love to know what brought you to FXPIG"},e.ready=function(a){e.readyQueue.push(a)};var t=a.createElement("div");t.id="Kykw__app",t["class"]="k-widget",a.body.appendChild(t);var o=a.createElement("script");o.type="text/javascript",o.async=!0;var i="https://fxpig.kayako.com/__apps/widget/assets/visitor/javascript/production.min.js";o.src=i;var s=a.getElementsByTagName("script");s=s[s.length-1],s.parentNode.insertBefore(o,s)}(document,window.kayako||[]);</script>
And you can see what the new code does here: http://fxpig-v4-current.webflow.io/
(To load the site you need to inspect and then remove the display:block)
There has to be some conflict within webflow that is stopping this script from running, but I have no idea what it might be.
Any ideas? REALLY appreciate the help