I have jQuery that through msg back to the div with particular ID.
here is part of the code:
$(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');
};
...
So what i need is just inform google analytics about this event through smth like:
ga(‘send’, ’event’, ’string1’, ’string2’, ’Failed’);
How can i do that correctly?