Tracking Gravity Form Submissions with Google Tag Manager

If you’re using Gravity Forms and want to track form submissions as conversions in your analytics tools or advertising platforms, Google Tag Manager (GTM) can help you set this up efficiently.
  • Set Up the Event Listener Code Start by creating a Custom HTML Tag in GTM. Paste the provided event listener code into this tag and set it to trigger on Pageview or DOM Ready to ensure it loads correctly on your form page.
  • Create a Custom Event Trigger Next, create a custom event trigger in GTM. Set the event name to [formSubmissionSuccess], which will allow your tag to fire only upon successful form submissions. This ensures accurate tracking of conversions in your analytics and advertising platforms, such as Google Analytics and Meta Pixel.
  • Capture the Form ID To capture specific form details, create a Data Layer Variable with the key [formID]. This variable will automatically capture the Gravity Form ID and can be used as an event parameter within your analytics setup. This helps you analyze performance for individual forms.
This setup will enable you to monitor and optimize your form submissions, gaining insights into user interactions and conversion metrics across platforms.
				
					<script type="text/javascript">
jQuery(document).ready(function() {
    // Debounce to prevent duplicate submissions
    let formSubmitted = false;
    
    jQuery(document).bind("gform_confirmation_loaded", function(event, formID) {
        if (!formSubmitted) {
            window.dataLayer = window.dataLayer || [];
            window.dataLayer.push({
                event: "formSubmissionSuccess",
                formID: formID
            });
            formSubmitted = true; // Prevents duplicate submissions
        }
    });
});
</script>

				
			

Leave a Reply