Manychat MC嵌入监听器/回调

时间:2018-08-15 07:10:38

标签: javascript

我正在使用多次聊天mc-embed。但是没有听众来检查和提交。有谁知道如何使用它?两者都没有触发:

这是他们唯一的文档:https://support.manychat.com/support/solutions/articles/36000012876-growth-tools-library-api-docs

<main role="main" class="container">
            <h1 class="mt-5">Manychat</h1>
            <p><div class="mcwidget-embed" data-widget-id="xxxx"></div></p>
        </main>

Javascipt

<script>
    window.mcAsyncInit = function() {
        // MC variable is available now
        var widget_id = xxxx;

        console.log("MC: ",MC);
        console.log("MC.getWidget(): ",MC.getWidget(widget_id));
        var widget = MC.getWidget(widget_id);

        widget.on('checked', function(event) {
            console.log('handle `checked` event', event);
            alert('handle `checked` event', event);

        });

        widget.on('submitted', function(event) {
            console.log('handle `submitted` event', event);
             alert('handle `submitted` event', event);
        });

    };
</script>

0 个答案:

没有答案