← All Guides

Gravity Forms Conversion Tracking with Google Tag Manager (GA4, Google Ads and Meta)

Track Gravity Forms submissions accurately with Google Tag Manager using the gform_confirmation_loaded event, with a thank-you page fallback. Send the lead to GA4, Google Ads with Enhanced Conversions, and Meta.

Atiqul Islam
Written by Atiqul Islam

Tracking & analytics specialist. 278+ GTM, GA4 and server-side tracking projects for clients in the US, UK and Australia.

Rather not do this yourself? I set this up for clients every week. Free 15-minute audit, no obligation.

Book a Free Audit

Gravity Forms is the most common form plugin I find on WordPress sites for lead generation businesses, and the most common tracking setup I find with it is a thank-you page that anyone can open directly, or a button click trigger that counts failed submissions.

Gravity Forms gives you a cleaner option. When a form is embedded with AJAX enabled, it fires a gform_confirmation_loaded event after a successful submission, with the form ID attached. This guide shows how to use that event in Google Tag Manager, plus a fallback for forms without AJAX.

Two Ways Gravity Forms Confirms a Submission

Check which one your form uses under Form Settings, then Confirmations, and check whether AJAX is enabled in the block or shortcode.

Method 1: The Confirmation Event

Step 1: Capture the email before submission

Add a Custom HTML tag named Listener - Gravity Forms firing on All Pages:

<script>
(function () {
  if (!window.jQuery) { return; }
  var lastEmail = '';
  var lastPhone = '';

  jQuery(document).on('submit', 'form[id^="gform_"]', function () {
    var email = this.querySelector('input[type="email"]');
    var phone = this.querySelector('input[type="tel"]');
    lastEmail = email ? email.value.trim().toLowerCase() : '';
    lastPhone = phone ? phone.value.trim() : '';
  });

  jQuery(document).on('gform_confirmation_loaded', function (event, formId) {
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({
      event: 'form_submit_success',
      form_tool: 'gravity_forms',
      form_id: String(formId),
      user_email: lastEmail || undefined,
      user_phone: lastPhone || undefined
    });
  });
})();
</script>

The first handler stores the email and phone at the moment of submission, because the form fields are removed from the page by the time the confirmation loads. The second handler pushes the success event with the form ID.

Step 2: Variables and trigger

Create Data Layer Variables for form_id, user_email and user_phone. Create a Custom Event trigger for form_submit_success. To track a single form, add a condition where form_id equals that form's numeric ID, visible in the Gravity Forms admin list.

Step 3: Tags

Method 2: Thank-You Page Fallback

If your form redirects:

  1. Create a Page View trigger where Page Path equals the thank-you page path.
  2. Fire the same GA4, Google Ads and Meta tags on it.
  3. Add a noindex tag to the thank-you page and remove it from the sitemap and navigation.
  4. For Enhanced Conversions, pass the email through the redirect as a query parameter from Gravity Forms confirmation settings, read it with a URL variable, and clear it from the URL with a history replace afterwards. If that feels like too much exposure, skip Enhanced Conversions on this form.

The redirect method cannot stop someone from opening the thank-you URL directly, which is why Method 1 is preferred.

Testing

  1. In GTM Preview, submit the form. Confirm form_submit_success appears with the correct form_id, and that email and phone are populated if you captured them.
  2. Confirm each tag fired exactly once.
  3. Inspect the outgoing Google Ads request with a tag debugger such as the Insighter Debugger extension and confirm the hashed user data is present.
  4. Submit the form with a validation error. Nothing should fire.
  5. For multi-page forms, move through the pages. Nothing should fire until the final submission.

Common Problems

Summary

Use the gform_confirmation_loaded event with AJAX forms, capture the contact fields on submit, and fire GA4, Google Ads and Meta from one dataLayer event. It takes 15 minutes and removes every false conversion a thank-you page or button click would have counted.

Frequently Asked Questions

Do I need AJAX enabled on the form?

For the event method, yes. The gform_confirmation_loaded event only fires when the form is embedded with AJAX enabled. If AJAX is off, the page reloads and you should use the thank-you page or confirmation message method instead.

My form redirects to a thank-you page. Which method should I use?

Use a Page View trigger on the thank-you URL, and block the page from search engines so organic visitors cannot land on it. If possible, switch the confirmation to an AJAX text confirmation and use the event, which is more accurate.

Can I pass the lead's email to Google Ads for Enhanced Conversions?

Yes. Capture the email field value before submission using the gform_pre_submission JavaScript hook or by reading the field on submit, store it in a variable and push it with the success event. The Google Ads tag hashes it in the browser.

How do I track multi-page Gravity Forms?

The confirmation event fires only on final submission, so multi-page forms work without changes. If you want to track page progress, use the gform_page_loaded event to push a step event.

Why does the generic GTM form trigger not work?

Gravity Forms submits by AJAX and the built-in trigger fires before validation. It counts failed and spam submissions and often fires on every page of a multi-page form.

Want This Done Right the First Time?

Book a free 15-minute audit call. I'll review your setup, show you what is broken, and tell you exactly what it takes to fix it.

Chat Now