Ninja Form Event Listener
How to track Ninja Form Submissions with google tag manager
Tracking Ninja form submissions as conversion in your analytics and advertising platform is easy and seamless, using Google Tag Manager and this event listener.
Start by creating a custom HTML tag type in Google Tag Manager, copy the Ninja form event listener code, paste it in the tag, add a pageview or DOM ready trigger.
The next step is to create a custom event trigger with an event name [ninjaFormSubmission] which happens only on successful form submissions.
To capture the form ID, create a dataLayer variable with a key [NFformID]
Finally, you can now connect your marketing tags/pixels using the custom event for Ninja form submission [ninjaFormSubmission] with the form ID variable, you can push the form ID to your analytics.
The creator of this code is Chris Berkley
<script> jQuery(document).ready( function() { jQuery(document).on('nfFormSubmitResponse', function(event, response, id) { dataLayer.push ({ 'event' : 'ninjaFormSubmission', 'NFformID' : response.id }); }); }); </script>