function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sam Sam 85Sam Sam 85 

Embedded Service - Embedded Web Chat Default Salesforce Chat Button Issue

Hi everyone, 

I am currently running into an issue with my "Embedded Service - Embedded Web Chat".  I have a custom chat button on the bottom right corner of my web page.

When a user clicks on the custom chat button, the web chat is displayed.  Next the user clicks on the minimize button that's availabe on the web chat.  The minimize button is an out-of-the-box button that's included as part of the web chat.  The web chat is minimized.  But what is displayed is the default out-of-the-box Salesforce chat button.

How do I go about making the default Salesforce chat button not be displayed?  Is there some out-of-the-box function/method I can use or call?  Or is there a setting/configuration that indicates to not display the default Salesforce chat button when the web chat is minimized?

Only my custom chat button should be displayed when the web chat is minimized.

I am stuck on this issue for a couple of days.  Much appreciate any help on this.

Thank you.

User-added image

Html Code:
<div id="divContainer">
	<img id="imgChatBubble" src="..." />
</div>

Javascript Code:
​​​​​​​
var initESW = function (gslbBaseURL) {
	
	embedded_svc.settings.displayHelpButton = false; 
	embedded_svc.settings.language = ''; 

	embedded_svc.settings.enabledFeatures = ['LiveAgent'];
	embedded_svc.settings.entryFeature = 'LiveAgent';
		
	embedded_svc.settings.widgetHeight = "90%";

	embedded_svc.init(
		'...',
		'...',
		gslbBaseURL,
		'...',
		'...',
		{
			baseLiveAgentContentURL: '...',
			deploymentId: '...',
			buttonId: '...',
			baseLiveAgentURL: '...',
			eswLiveAgentDevName: '...',
			isOfflineSupportEnabled: true
		}
	);
};

if (!window.embedded_svc) {
	var s = document.createElement('script');
	s.setAttribute('src', '...');
	s.onload = function () {
		initESW(null);
	};
	document.body.appendChild(s);
}
else {
	initESW('https://service.force.com');
}

function setupChatBubble() {

	var $imgChatBubble = $("#imgChatBubble");

	$imgChatBubble.on("click", function (e) {

		// Display the web chat.
		embedded_svc.liveAgentAPI.startChat();
		
		// Hide chat bubble.
		$imgChatBubble.fadeOut({

			duration: 400
		});
	});
}

function displayChatBubble() {

	var $imgChatBubble = $("#imgChatBubble");

	// Show chat bubble.
	$imgChatBubble.fadeIn({

		duration: 400
	});
}

function setupAfterMinimizeEventHandler() {

	embedded_svc.addEventHandler("afterMinimize", function (data) {

		displayChatBubble();
	});
}

function setupAfterDestroyEventHandler() {

	embedded_svc.addEventHandler("afterDestroy", function (data) {

		displayChatBubble();
	});
}

setupChatBubble();

setupAfterMinimizeEventHandler();

setupAfterDestroyEventHandler();

​​​​​​​
Nethru KalyaanNethru Kalyaan
Had the same issue and was looking for a solution on my web page. Thinking of removing it. I have been having problems with the chat button for a while now. My website is mainly WordPress (https://intoptrend.com/) and looking for a new plugin that might help I hope. Went through the below Salesforce article and found some helpful insight. What worked for you? 

https://help.salesforce.com/s/articleView?id=sf.snapins_create_deployment.htm&type=5 (https://help.salesforce.com/s/articleView?id=sf.snapins_create_deployment.htm&type=5)