Created
January 13, 2020 20:51
-
-
Save sudarshann/065ae6a075ded75a243f1d88d0fa4e21 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery( document ).ready( function() { | |
jQuery( document ).on( 'nfFormSubmitResponse', function(event, response, id) { | |
console.log("Google Analytics Ninja form Tracking Triggered ", event, response); | |
if(typeof ga === "undefined"){ | |
return; | |
} | |
if(response.id === "1"){ | |
/* Limit by form id */ | |
/* gtag('event', <action>, { | |
'event_category': <category>, | |
'event_label': <label>, | |
'value': <value> | |
}); */ | |
gtag('event', 'Ninja Form', { | |
'event_category' : 'form-' + response.id , | |
'event_label' : 'Submit', | |
'non_interaction': true | |
}); | |
} | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment