How dangerous is e.preventDefault();, and can it be replaced by keydown/mousedown tracking?

前端 未结 7 1921
隐瞒了意图╮
隐瞒了意图╮ 2021-02-04 17:51

I\'m working on a tracking script for a fairly sophisticated CRM for tracking form actions in Google Analytics. I\'m trying to balance the desire to track form actions accuratel

7条回答
  •  甜味超标
    2021-02-04 18:26

    Is there a reason why you can't just issue the call to Google Analytics from the server side based on the POST that it receives?

    I don't know what your system is built in, but for instance, this PHP project would issue a call to GA, thus removing the problem of the DOM unloading, the need to break the form, and so on.

    http://code.google.com/p/serversidegoogleanalytics/

    I realise that you might need to capture a cookie - you might write the value into a hidden field in the form before it is submitted?

提交回复
热议问题