google analytics - Sending an event after sucessful ajax form submission -
so have created custom goal in ga:
and have ajax e-mail form want send event when form correctly submitted (using analytics.js):
jquery.post(url, {name:name, surname:surname, email:email, country:country}, function(data) { if(data) { if(data=="some fields missing.") { // } else if(data=="invalid email address.") { // } else if(data=="already subscribed.") { // } else { // successful message ga('send', 'event', { eventcategory: 'form', eventaction: 'optin', eventlabel: '7 dicas para o sucesso nas redes' }); } } else { // } } );
the form working fine, every time add user list, analytics goal still stuck @ 0.
Comments
Post a Comment