bratsun
2/6/2014 - 3:58 PM

Webform with ajax - success callback and GA push

Webform with ajax - success callback and GA push

if ($('.node-webform .webform-confirmation').length > 0 && !$('.node-webform .webform-confirmation').hasClass('done-done')) {
    $('.node-webform .webform-confirmation').addClass('done-done');
    _gaq.push(['_trackEvent', $('#pc-5 h2, #node-46 h2.node-title').eq(0).text() + ' form', 'Form submitted']);
  }