0

我试图找出是否可以在成功提交后实施分析事件来跟踪 Muse WebPro.js 表单小部件中的转化?

以下是执行表单提交的 Muse WebPro.js 中的代码:

Muse.Utils.initWidget('#widgetu2128', ['#bp_infinity'], function(elem) {
    return new WebPro.Widget.Form(elem, {
        validationEvent: 'submit',
        errorStateSensitivity: 'high',
        fieldWrapperClass: 'fld-grp',
        formSubmittedClass: 'frm-sub-st',
        formErrorClass: 'frm-subm-err-st',
        formDeliveredClass: 'frm-subm-ok-st',
        notEmptyClass: 'non-empty-st',
        focusClass: 'focus-st',
        invalidClass: 'fld-err-st',
        requiredClass: 'fld-err-st',
        ajaxSubmit: true
    });
}); /* #widgetu2128 */

我的想法是在此处插入分析事件跟踪代码,例如此处:

Muse.Utils.initWidget('#widgetu2128', ['#bp_infinity'], function(elem) {
    return new WebPro.Widget.Form(elem, {
        validationEvent: 'submit',
        errorStateSensitivity: 'high',
        fieldWrapperClass: 'fld-grp',
        formSubmittedClass: 'frm-sub-st',
        formErrorClass: 'frm-subm-err-st',
        formDeliveredClass: 'frm-subm-ok-st',
        notEmptyClass: 'non-empty-st',
        focusClass: 'focus-st',
        invalidClass: 'fld-err-st',
        requiredClass: 'fld-err-st',
        onSuccess: function(){
            ga('send', 'event', 'Form', 'Send', '');
        },
        ajaxSubmit: true
    });
}); /* #widgetu2128 */

但它似乎不起作用。任何人都有任何建议。在线找不到有关此主题的任何 WebPro.js 文档或支持。

谢谢!

4

1 回答 1

1
 //validate

Muse.Utils.initWidget('#widgetu812', function(elem) { 
  new WebPro.Widget.Form(elem, 
  {
      validationEvent:'submit',
      errorStateSensitivity:'high',
      fieldWrapperClass:'fld-grp',
      formSubmittedClass:'frm-sub-st',
      formErrorClass:'frm-subm-err-st',
      formDeliveredClass:'frm-subm-ok-st',
      notEmptyClass:'non-empty-st',
      focusClass:'focus-st',
      invalidClass:'fld-err-st',
      requiredClass:'fld-err-st',
      ajaxSubmit:true
   }
  );
});/* #widgetu812 */

//submit

<script> $(document).ready(function() { 
  $("#widgetu812").ajaxComplete(function() {   
       if (typeof ga !== 'undefined') {       
         ga('send','event','order','sent');   
       }
 }); }); </script>
于 2016-09-01T21:18:52.640 回答