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’
wpformsAjaxSubmitSuccessevent. It only fires when a form is submitted successfully, so it doesn’t count errors or empty clicks. Push awpforms_submitevent to the dataLayer with the form ID, then fire your GA4generate_leadevent 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:
| Method | Problem |
|---|---|
| GTM “Form Submission” trigger | Often doesn’t fire with AJAX; counts failed submits when it does |
| Click on the submit button | Counts every click, including errors and double clicks |
| “Element visibility” of the confirmation message | Works, but breaks when the message text or layout changes |
| Thank-you page redirect | Reliable, but only if people can’t reach the page another way |
wpformsAjaxSubmitSuccess listener | Fires 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 plainaddEventListenerwon’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
- Data Layer Variables:
form_idandform_name. - Custom Event trigger: event name
wpforms_submit. Optional: add a condition such asform_id equals 123if 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:
- In the listener, also read the email field (for example
form.querySelector('input[type="email"]').value) and push it asuser_emailin the same dataLayer event. - In the Google Ads tag, add User-provided data → email =
{{DLV - user_email}}. Google hashes it before sending. - 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
- GTM Preview: submit the form with an error first (leave a required field empty). No
wpforms_submitshould appear. - Submit correctly. You should see one
wpforms_submit, and the GA4 and Google Ads tags fire once each. - GA4 DebugView:
generate_leadarrives withform_id. - 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_leadkey 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.
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.
