Gravity Form Event Listener

How to track Gravity form submissions with Google Tag Manager

With Gravity Form, you can quickly build complex powerful forms, polls, quizzes and more with no coding required!

With this simple Event Listener, you can track interactions like form submission on Gravity form. Simply copy the code into your Google Tag Manager with the necessary configuration and you are ready to begin collecting those events when they trigger.

How to track Gravity form submissions with Google Tag Manager

You’ll need Google Tag Manager and the Gravity form submission event listener javascript code.

The code

    				
    					<script type="text/javascript">
    jQuery(document).ready(function() {
    jQuery(document).bind("gform_confirmation_loaded", function(event, formID) {
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({
    event: "formSubmissionSuccess",
    formID: formID
    });
    });
    });
    </script>
    				
    			
    • Start by creating a custom HTML tag where you’ll paste the event listener code and fire it on pageview or DOM ready.
    • Create a custom event with the event name [formSubmissionSuccess]
    • Optionally, create a dataLayer variable [formID] to collect the form ID and send it to your analytics platform along with the event.
    • The event happens only on successful submission of Gravity forms
    • Connect your marketing tag(s) to this trigger to send events to your analytics platform like GA4.
    • Trust But Verify (TBV). Test, test and debug
    • Publish once everything is okay.

     

    Credit: The code was created by Julius Fedorovicius

    Share the Post: