The following pattern can be used to instantiate your own Mutation Observer in the Always Execute section of your experiments in Ascend:

    // select the target node
    var target = document.querySelector("#chat-container");
    // create an observer instance
    var observer = new MutationObserver(function(mutations) {
        var chatCTA = document.querySelector("button[data-test='chat-submit-message']");

            $(chatCTA).click(function(){ window.ascend.trigger(); });
            $("#widgetInputCarcodeWidget").keypress(function(e) { if(e.which == 13) { window.ascend.trigger(); } });
    // configuration of the observer:
     var config = { attributes: true, childList: true, characterData: true, subtree: true };
    // pass in the target node, as well as the observer options
     observer.observe(target, config);

Did this answer your question?