0:05
hello everyone in this video we are
0:07
going to see how to automatically launch
0:11
Salesforce messaging for web chat window
0:14
in experience cloud site when the
0:17
experience cloud site page is loaded
0:20
in order to achieve this use
0:23
case we can make use of embedded service
0:28
bootstrap dot util API dot launch chat
0:35
method the first step is we have to go
0:38
to the experience cloud site builder in
0:41
the experience cloud site builder go to
0:44
settings select advanced click edit head
0:48
markup and add this JavaScript code
0:51
snippet here I am making use of window
0:55
add event listener and I'm going to
0:58
listen to on embedded messaging button
1:00
created uh event whenever this event is
1:03
fired it will uh go and invoke embedded
1:08
service bootstrap to API chat
1:13
method this on embedded messaging button
1:16
created will be fired when the chat icon
1:20
is ready to be displayed and uh rendered
1:24
the HTML DOM so the but the chat icon
1:28
will be available uh to initiate the
1:31
messaging for uh um web messaging
1:35
session so when that is available and
1:38
when whenever it is ready then on
1:41
embedded messaging button created event
1:43
will be fired so this is an out of the
1:45
box Salesforce uh messaging for web
1:48
event so this event will be fired and we
1:51
can listen to it and then we can use
1:53
this uh launch chat method and then we
1:56
should be able to do it in Salesforce
2:00
we have to go to the head markup and
2:03
then we have to add that uh
2:05
JavaScript so we have to go to
2:08
experience cloud site builder settings
2:10
advanced click edit head markup copy
2:17
code save it publish it in order to test
2:20
it I'm going to copy the Experience
2:25
link now when I open this
2:32
automatically launch the experience
2:35
cloud site so it opened the experience
2:38
cloud site and on the page load of the
2:41
experience cloud site the embedded uh
2:44
service deployment for messaging for web
2:48
automatically got launched
2:58
please check the video description in
3:00
the video description I have shared my
3:02
blog post from the blog post you should
3:04
be able to get the sample JavaScript
3:06
code snippet for your
3:14
reference i hope it was
3:20
helpful thank you for watching