Is it possible to start the chat but without opening new window? I would like to have the chat inside a div on existing page. I don't want pre chat forms or anything like that. Just start the chat inside existing page. I'm using Deployment API to setup and initiate chat.
-
i'm very interested in achieving the same. Would you mind sharing the URL address where your chat is available, so i could show an example of the implementation?– user26560Nov 23, 2015 at 10:07
-
@Anni I can't. The Salesforce chat component is a piece of crap and the company migrated to a dedicated chat provided that does things properly.– SiliconMindNov 23, 2015 at 13:52
4 Answers
Yes it is possible to do so by using "startChatWithWindow()" from the Live Agent API. By passing in the name of an iFrame it will open up the chat within the iFrame instead of a new window.
The documentation can be found below.
-
I'd call this an undocumented feature. The docs clearly say about window name. Mar 5, 2015 at 10:37
-
@Patriot, what do you as the name of the iframe? I was thinking it's id, but that doesn't seem to be working for me. May 29, 2015 at 13:52
-
1@TallPaul for some browsers you need to set iframe name AND id attributes. May 29, 2015 at 14:18
-
-
does this have to be an iframe? I tried it with a div, but it just popped up. I did get it to work with the iframe, but prefer to div Jan 11, 2019 at 15:39
this should probably work. include this in <a.../a>
tag
onclick="liveagent.startChatWithWindow('xxxxxxxxxxxxx' , 'name_of_your_iframe')"
If using iFrame is not ideal (not mobile friendly), in the same page file, give it a window name first.
<script type="text/javascript">
window.name = 'chatchat'
</script>
Open the chat or pre-chat form within the same window.
liveagent.startChatWithWindow('573A0000000XXXX','chatchat')
Now have a new feature name Embedded chat service you can use live chat without pop-up in a new window. And there is trail modules too.
https://trailhead.salesforce.com/content/learn/modules/web-chat