google analytics - Sending an event after sucessful ajax form submission -


so have created custom goal in ga:

custom goal ga screenshot

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

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -