onEmbeddedMessagingConversationOpened event can be listened to detect or check whether page occurred for the Salesforce Messaging for Web.
Blog Post:
https://www.infallibletechie.com/2025/04/detect-page-load-for-salesforce-messaging-for-web.html
Show More Show Less View Video Transcript
0:04
hello everyone in this video we are
0:07
going to see how to detect page load for
0:10
sales for Salesforce messaging for web
0:13
implementation if you are making use of
0:15
Salesforce messaging for web feature in
0:18
your site and then if you wanted to
0:21
detect whether the page got loaded or
0:24
whether the users navigated from one
0:26
page to another then we can track that
0:30
with the help of on embedded messaging
0:32
conversation opened event
0:35
this on embedded messaging conversation
0:38
opened event will be triggered or
0:40
invoked whenever the users loads the
0:44
page or whenever they navigate from one
0:48
page to another
0:51
page i am making use of window addevent
0:54
listener for this on embedded messaging
0:57
conversation opened event i have added
1:00
console.log statements just for this
1:03
demo you can make use of this code as a
1:05
reference and then you should be able to
1:07
achieve your use case where you wanted
1:09
to track or detect page navigation or
1:13
page load in Salesforce messaging for
1:16
web
1:17
feature you should add this code snippet
1:20
along with the embedded service
1:23
deployment code snippet which we get it
1:25
from the Salesforce setup
1:28
i have added Salesforce
1:30
article using which you will be able to
1:33
get more information about this
1:35
particular event and also the other
1:37
events that are available
1:40
uh for Salesforce for
1:42
messaging for web events so if you
1:45
wanted to explore other events that is
1:47
available for uh Salesforce for
1:50
Salesforce messaging for web then you
1:52
can make use of this
1:54
article let's look at a demo
1:58
this is a
2:01
page it is ending with MAW the path is
2:05
MAW if I click this open new page then
2:08
it navigates to another page m A W new
2:14
page so let me start the messaging
2:16
session
2:22
so
2:28
here I'm going to say
2:34
test so when I navigate to another
2:38
page I'm able to see start conversation
2:42
opened and this is the page here i'm
2:46
going to say demo
2:49
if I navigate back then the page reloads
2:52
or loads again so I should see it is
2:56
loading from this particular page
2:59
location if I open this one then it
3:01
navigates to this page and it
3:04
loads if I go back it is loading from
3:08
this
3:09
particular page so you should be able to
3:13
make use
3:15
of on embedded messaging conversation
3:19
opened event to listen to the page loads
3:24
and then you should be able to track it
3:26
this is the code which is used in my uh
3:31
first initial page
3:34
so this is where I have added this uh
3:37
code snippet for
3:40
uh event listener same code is used here
3:44
the only change is I'm not using this
3:46
anchor
3:51
tag please check the video description
3:54
in the video description I have given my
3:56
blog post from the blog post you should
3:58
be able to get the sample code which is
4:01
referenced in this video and also a
4:04
screenshot where I have given how to and
4:07
where to add this code snippet along
4:09
with your Salesforce embedded service
4:11
deployment code snippet from the
4:12
Salesforce
4:15
setup as I said earlier you can also
4:18
make use of this Salesforce article for
4:20
all additional events that are available
4:23
in Salesforce messaging for web feature
4:32
i hope it was
4:37
helpful thank you for watching
#Internet Software
