0

我正在使用 mixpanel JS 作为指标,当用户尝试提交表单并且有一个复选框允许用户注册 newsletter 时,我必须为表单捕获一个事件。我想跟踪注册并选中该框的用户,但不知道如何解决这个问题。这就是我的表格的样子

<form id="form_send_email" novalidate="novalidate"> 
<input type="text" name="first_name" id="first_name" placeholder="First Name"/>
<input type="text" name="last_name" id="last_name" placeholder="Last Name"/>
<input type="text" name="email" id="email" placeholder="Email"/>
<br/>
<input type="checkbox" name="learn_more" id="learn_more" class="css-checkbox" checked="checked"/>
<label for="learn_more" id="learn_more_label" class="css-label">Learn more about our products and sign up</label>
</form>
4

1 回答 1

0

通常,在将表单实际发送到服务器之前,需要对表单进行一些客户端验证。有很多 JS 库可以帮助你,例如jQuery 。然后,如果所有数据都正常,将跟踪请求发送到 mixpanel 并提交表单。

Mixpanel 有很多语言的客户端库,你可能想从你的服务器发送跟踪请求?

于 2014-02-27T23:25:23.030 回答