我有jQuery通过msg返回到具有特定ID的div。
这是代码的一部分:
$(function(){
$('#contactform').submit(function(){
$.ajax({
url:'result.php',
type : 'POST',
dataType: 'json',
data: $(this).serialize(),
success: function(data){
if(data.error){
$('#error').text(data.reg_error)
$('#reg_error').load('msg/return_msg1.php');
};
...
所以我需要的是通过smth告知谷歌分析这个事件,如:
ga(‘send’, ’event’, ’string1’, ’string2’, ’Failed’);
我该如何正确地做到这一点?