Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
437 views
in Technique[技术] by (71.8m points)

javascript - 来自segment.io的Track.form代码段取消了表单的重定向(Track.form snippet from segment.io cancels redirect of the form)

After form submission, it has to redirect to another page:(提交表单后,它必须重定向到另一个页面:)

$("#formId").signUp({ APIUrl : 'https://website.com/api/register_user', redirectUrl : 'staging' });

But, after I install track.form snippet in the footer, redirect is not working and page with form just reloads.(但是,在页脚中安装track.form代码段后,重定向不起作用,并且仅重新加载了带有表单的页面。)

var form = $('#formId'); analytics.trackForm(form, 'Signed Up Spanish', { email: document.email });

  ask by Andrii Gorh translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

See question and answer from Tim Macchi at https://forum.webflow.com/t/segment-trackform-interferes-with-form-behavior/67474(请参阅Tim Macchi的问答, 网址https://forum.webflow.com/t/segment-trackform-interferes-with-form-b??ehavior/67474)

<script type="text/javascript">
  $( ".as-form" ).submit(function( event ) {
    analytics.track('as masterclass signup', {
    }); 
  });
</script>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...