Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Messenger event callbacks via JavaScript

    Posted 08-26-2024 08:22
    No replies, thread closed.

    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
    ------------------------------


  • 2.  RE: Messenger event callbacks via JavaScript

    Posted 08-26-2024 09:12
    No replies, thread closed.

    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
    ------------------------------



  • 3.  RE: Messenger event callbacks via JavaScript

    Posted 08-26-2024 09:37
    Edited by Sean McGill 08-26-2024 09:38
    No replies, thread closed.

    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
    ------------------------------



  • 4.  RE: Messenger event callbacks via JavaScript
    Best Answer

    Posted 08-27-2024 08:12
    No replies, thread closed.

    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
    ------------------------------



  • 5.  RE: Messenger event callbacks via JavaScript

    Posted 08-27-2024 09:02
    No replies, thread closed.

    Great, that's working - thank you



    ------------------------------
    Sean McGill
    Rightworks
    ------------------------------