Track form submissions as conversions in GA4

Most WordPress forms submit without a page change, so nothing reaches GA4 unless an event fires. How to track form conversions with the generate_lead event.

Last updated ·

The problem

A form submission is a conversion, but out of the box it is invisible to analytics. Modern WordPress form plugins submit over AJAX: the visitor stays on the same URL, no new page loads, and no pageview or event reaches GA4. Your most important non-purchase conversion produces no data at all.

The common workaround, redirecting to a thank-you page and counting pageviews on it, is fragile:

  • Anyone who lands on the thank-you URL directly, from a bookmark or a shared link, counts as a conversion.
  • Page caching can serve the thank-you page in contexts that never involved a submission.
  • A pageview carries no context about which form was submitted or where.

The fix: a real event on the actual submission

The reliable pattern is an event pushed to the data layer at the moment the form plugin confirms a successful submission, using GA4’s standard lead event, generate_lead. In GA4 you then mark generate_lead as a key event, and it becomes a conversion you can attribute, segment and bid against.

GTM Kit wires this for you:

  • Contact Form 7 (free, built into GTM Kit): on a successful submission, GTM Kit pushes its gtmkit.CF7MailSent event and, when the generate_lead engagement event is enabled, the standard generate_lead event in the same moment, with form metadata in the payload.
  • Gravity Forms (GTM Kit Premium): the same generate_lead pattern fires on the Gravity Forms confirmation, covering AJAX and non-AJAX submissions. Premium also persists the visitor’s acquisition attribution to the form entry itself, so every lead in your Gravity Forms entries carries the source, medium and campaign that produced it. Your sales follow-up sees where each lead came from, not just that it arrived.

Developers can extend the generate_lead payload with extra fields through the gtmkit_engagement_event_generate_lead_payload filter.

Set it up

  1. Enable the generate_lead engagement event in GTM Kit’s settings.
  2. In your GTM container, forward the event to GA4 (the GTM Kit container templates include this mapping).
  3. In GA4, mark generate_lead as a key event.
  4. Submit a test form with GTM Preview open and confirm the event fires once, on submission, not on page load.

Run a Tracking Health Check to see which conversions your current setup captures.

← Previous

Previous article

Next →

Next article