I am trying to track event on success of $.ajax function and then redirect the page. Unfrotunatly the tracking wont appear on analytics and I belive this is because my redirect wont let the tracking finish it's job. I heard I can detect when data is passed to google analytics but could not figure it out.
$.ajax({
type : "POST",
url : formActionAttr,
data : datastring,
success : function() {
//analytics tracking
_gaq.push(['_trackEvent', 'Category 1', 'Success', formActionAttr]);
window.location.href = pdfurl;
}
});
appreciate any help!