Original Message:
Sent: 08-27-2024 08:12
From: Angelo Cicchitto
Subject: Messenger event callbacks via JavaScript
We rely on Messenger publishing Events on its internal event bus. For example, in this case you could subscribe the Messenger.opened event (which is published after user click on the button). If you need more granular events, these can be raised as Ideas for future evaluation.
------------------------------
Angelo Cicchitto
Genesys - Employees
Original Message:
Sent: 08-26-2024 09:36
From: Sean McGill
Subject: Messenger event callbacks via JavaScript
Sure, I apologize as I'm not super familiar with Genesys however we have the script injection above that instantiates the following 'chat' or 'messenger' button on our application 
And it's injected as such

So was wondering if there's some way to get a callback or an event of some sort in the initialization script as to when that button is clicked or a session is started basically, so that we can act to track it on our end
Thanks
------------------------------
Sean McGill
Rightworks
Original Message:
Sent: 08-26-2024 09:11
From: Angelo Cicchitto
Subject: Messenger event callbacks via JavaScript
Hi - can you describe use-case you're trying to solve? What "chat button" are you referring to?
For developer assistance I may also recommend Developer Center and Forum resources > https://developer.genesys.cloud/commdigital/digital/webmessaging/messengersdk/SDKCommandsEvents/
------------------------------
Angelo Cicchitto
Genesys - Employees
Original Message:
Sent: 08-26-2024 08:22
From: Sean McGill
Subject: Messenger event callbacks via JavaScript
I have a task in which I need to intercept an event when the Genesys messenger chat button is clicked. I just need to get a basic callback event of some sort so I can act on it. I've been digging a bit and I see documentation referring to using ac 'on' , though I'm thinking this is not correct for the version/product we are using which is
* messenger
* @version: 2.11.4
* @license: Genesys Cloud Services, Inc.
Given the following injection snippet, can someone direct me as to how I could setup an event callback to know when someone clicks the chat button?
(function (g, e, n, es, ys) {
g["_genesysJs"] = e;
g[e] =
g[e] ||
function (...args) {
(g[e].q = g[e].q || []).push(args);
};
g[e].t = new Date();
g[e].c = es;
ys = document.createElement("script");
ys.async = 1;
ys.src = n;
ys.charset = "utf-8";
document.head.appendChild(ys);
})(
window,
...
Any help is much appreciated, thanks!
#API/Integrations
------------------------------
Sean McGill
Rightworks
------------------------------