Back to the Shapespark home page

Adding online chat

hi i am trying to add my onwebchat code to my scen and nothing happens the code is like this :

We don’t have experience with onwebchat. Do you add this ‘Installation Code’ to the body-end.html file in Documents\Shapespark\SCENE-NAME? Could you share a link to the uploaded version of the scene? Perhaps there are some JavaScript console errors that would indicate what is the problem.

no ,i can’t find this file i looked up in this path

this is my scene link : 3D scene

The body-end.html file is not in the scene folder by default, you need to create such a file.

So i should creat html file with this name and put my code as script or html , and after that inside the scene should i do it as script or html lable ?

Just add this to the body-end.html file, you don’t need to add a Script or HTML Label extension after that. body-end.html file is automatically combined with the scene’s default index.html file.

but i need to click an object to pop up the chat

Does onwebchat have any API to pop up the chat? If yes, you can call such API function from the Script extension.

<script type='text/javascript'>
var onWebChat={ar:[], set: function(a,b){if (typeof onWebChat_==='undefined'){this.ar.
push([a,b]);}else{onWebChat_.set(a,b);}},get:function(a){return(onWebChat_.get(a));},
w:(function(){ var ga=document.createElement('script'); ga.type = 'text/javascript';
ga.async=1;ga.src=('https:'==document.location.protocol?'https:':'http:') + 
'//www.onwebchat.com/clientchat/9a08bf17638c291a8bd0039f15e771fb';var s=
document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);})()}
</script>

when i put the script in body-end.html it works but i want to call it out from a trigger, how i can do that in my scene ?

when i put the script in body-end.html it works but i want to call it out from a trigger, how i can do that in my scene ?

Same Question…

1 Like