【发布时间】:2014-04-16 15:36:12
【问题描述】:
我是 jQuery 和分析事件跟踪的新手。我正在寻找跟踪表单提交。我的逻辑是用户将点击“提交”,然后表单等待提交,直到有时间发送到 Google 的服务器。
跟踪工作正常,但您必须单击提交两次。有什么建议吗?提前感谢一堆。
jQuery("form").submit(function(e){
e.preventDefault();
ga('send', 'event', 'form', 'submission',location.pathname);
jQuery(this).unbind('submit');
setTimeout(function(){
jQuery(this).submit();
}, 200);
});
我的印象是,您必须阻止提交几秒钟才能让“gif”发送到 Google。
如果有帮助,这里是 URL: http://salisburyrugby.com/recruit-contact/
【问题讨论】:
标签: jquery forms google-analytics