Conversion Tracking

WPForms Conversion Tracking in GA4 and Google Ads with Google Tag Manager (2027)

Short answer: Turn on AJAX form submission in WPForms, then add a small listener in Google Tag Manager for WPForms’ wpformsAjaxSubmitSuccess event. It only fires when a form is submitted successfully, so it doesn’t count errors or empty clicks. Push a wpforms_submit event to the dataLayer with the form ID, then fire your GA4 generate_lead event and Google Ads conversion from it. If AJAX is off, use a thank-you page redirect instead.

WPForms is one of the most used form plugins on WordPress, with 5+ million active installations on its free version alone (WordPress.org). So “my WPForms leads aren’t tracking” is one of the most common problems I see in audits.

Why doesn’t GTM’s built-in form trigger work with WPForms?

GTM’s Form Submission trigger listens for the browser’s normal submit event. With AJAX on, WPForms sends the form in the background and stops the normal submit, so the built-in trigger often doesn’t fire. When it does fire, it can’t tell a successful submission from one that failed validation. Both lead to wrong numbers in Google Ads.

Other setups I see that cause problems:

MethodProblem
GTM “Form Submission” triggerOften doesn’t fire with AJAX; counts failed submits when it does
Click on the submit buttonCounts every click, including errors and double clicks
“Element visibility” of the confirmation messageWorks, but breaks when the message text or layout changes
Thank-you page redirectReliable, but only if people can’t reach the page another way
wpformsAjaxSubmitSuccess listenerFires only on success, gives you the form ID. My default.

Step 1: Turn on AJAX submission in WPForms

In WordPress → WPForms → edit your form → Settings → General → Advanced, tick Enable AJAX form submission. Save. The success event below only exists for AJAX submissions; WPForms’ own support confirms it “will only run if the form was submitted successfully” (WordPress.org support).

Step 2: Add the WPForms listener in GTM

Create a Custom HTML tag in GTM, fired on All Pages (or only pages with forms):

<script>
(function () {
  if (!window.jQuery) return;
  jQuery(document).on('wpformsAjaxSubmitSuccess', function (event) {
    var form = event.target;
    var formId = form && form.getAttribute ? form.getAttribute('data-formid') : '';
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({
      event: 'wpforms_submit',
      form_id: formId,
      form_name: (form && form.getAttribute('data-formname')) || ''
    });
  });
})();
</script>

Check two things:

  • It must use jQuery’s .on(). WPForms triggers this as a jQuery event, so a plain addEventListener won’t catch it. A WordPress.org support thread shows the same problem and fix (WordPress.org support).
  • jQuery must load before the tag runs. WordPress loads jQuery with WPForms. If a speed plugin delays all scripts, exclude jQuery or fire the tag on Window Loaded.

Step 3: Create the trigger and variables

  1. Data Layer Variables: form_id and form_name.
  2. Custom Event trigger: event name wpforms_submit. Optional: add a condition such as form_id equals 123 if only some forms are leads (your newsletter form probably shouldn’t count as a Google Ads conversion).

Step 4: Send the lead to GA4

Create a GA4 Event tag:

  • Event name: generate_lead
  • Parameters: form_id = {{DLV - form_id}}, form_name = {{DLV - form_name}}
  • Trigger: wpforms_submit

In GA4 → Admin → Events, mark generate_lead as a key event. Use one event name for every lead form and tell them apart with the form_id parameter. That keeps your reports clean.

Step 5: Send the lead to Google Ads with enhanced conversions

Create a Google Ads Conversion Tracking tag on the same trigger. Then turn on enhanced conversions so Google can match leads that lost their cookie:

  1. In the listener, also read the email field (for example form.querySelector('input[type="email"]').value) and push it as user_email in the same dataLayer event.
  2. In the Google Ads tag, add User-provided data → email = {{DLV - user_email}}. Google hashes it before sending.
  3. Set the conversion action to count One per click.

Only collect and send the email where your privacy policy and consent setup allow it. If enhanced conversions show as “not working”, see Google Ads enhanced conversions not working.

Step 6: Test before you trust it

  1. GTM Preview: submit the form with an error first (leave a required field empty). No wpforms_submit should appear.
  2. Submit correctly. You should see one wpforms_submit, and the GA4 and Google Ads tags fire once each.
  3. GA4 DebugView: generate_lead arrives with form_id.
  4. Google Ads → Goals → Conversions: the action shows “Recording conversions” within about 24 hours.

How do you stop double counting?

  • Don’t also run a WPForms or “GA4” plugin that sends its own form events to the same GA4 property.
  • Don’t import the GA4 generate_lead key event into Google Ads and use the Google Ads tag as Primary for the same lead. Pick one primary source.
  • If you also use a thank-you page redirect, choose one method, not both.

For WordPress setups in general, see WordPress dataLayer: plugin vs custom setup and tracking form validation errors in GTM.

Next level: know which leads became customers

A form fill isn’t a sale. If your leads go into a CRM, save the GCLID with each WPForms lead (a hidden field filled from a first-party cookie) and send qualified or won leads back to Google Ads as offline conversions. That’s how Google learns to find buyers, not just form-fillers. See the Google Ads offline conversion tracking guide.

Want it done for you?

I set up WPForms, Gravity Forms, Elementor, Contact Form 7 and HubSpot form tracking for brands and, white-label, for agencies, usually in a day, with testing and a short handover video. See my Google Ads consulting and GA4 consulting services.

Next step: get a free tracking audit or book a free 30-minute call.

Copy-paste listener: the WPForms listener (and listeners for other form and booking tools) is in my free GTM Listener Library.

Direct Implementation White-Label for Agencies

Need this implemented, audited, or white-labeled?

Whether you are an eCommerce brand owner fixing signal loss or a digital marketing agency needing a senior analytics engineer under strict NDA, I deliver 24–48h SLA turnaround with 8.5+ EMQ match rates.

✓ 24–48h Emergency SLA ✓ Strict Non-Solicitation & NDA ✓ 8.5+ Event Match Quality
Jobair Mahmud

Jobair Mahmud

AI-Driven Performance Marketing & Web Analytics Consultant

Helping eCommerce brands and marketing agencies trust their ads data, scale Smart Bidding, and eliminate wasted ad spend through bulletproof server-side tracking and PPC management.