Loading tutorials…
Loading tutorials…
Your forms convert — but only if your analytics know. Every WordPress form has its own quirks for firing tracking events. This walks through Gravity Forms, WPForms, and Contact Form 7 with the GA4, Meta Pixel, and Google Ads tracking that turns submissions into measurable conversions.
Who this is forWordPress site owners running lead-gen forms (contact, demo request, newsletter, quote request) who need every submission counted as a conversion in GA4, Meta Ads, and Google Ads.
What you'll need
Step 1
Three submission patterns: AJAX (no page reload — most modern), page reload (refresh after submit), thank-you redirect (separate confirmation URL). Each needs a different trigger.
AJAX submission: the form processes via JavaScript, shows a success message inline, no page reload. Gravity Forms (default), WPForms, Contact Form 7 (default) all submit via AJAX.
Page reload: form submission causes a page refresh, success message renders on the same URL. Rare in 2026 — usually only legacy themes/forms.
Thank-you redirect: form submission redirects to a separate /thank-you/ URL. Easiest to track (just fire on pageview of thank-you URL). Requires configuring your form to redirect, not show inline message.
Recommendation: configure forms to redirect to a thank-you URL when possible. Tracking becomes trivial (fire on thank-you pageview). Pros: clean UTM attribution. Cons: slightly worse UX (extra page load).
If staying with AJAX submission, proceed to the per-plugin event-trigger setup in the next steps.
Step 2
Gravity Forms emits a gform_confirmation_loaded JavaScript event on AJAX success. Capture it in GTM via Custom Event trigger.
GTM → Tags → New → Custom HTML. Paste this snippet (Gravity Forms data-layer push): <script>jQuery(document).on('gform_confirmation_loaded', function(event, formId){ window.dataLayer = window.dataLayer || []; dataLayer.push({event:'gform_submit', formId: formId}); });</script>
Trigger → All Pages. Save. (This snippet listens for Gravity Forms confirmation events and pushes to the data layer.)
GTM → Triggers → New → Custom Event. Event name: gform_submit. Save.
Now create tags that fire on this trigger:
GA4 event tag → 'Google Tag (GA4 Event)' → Configuration tag = your GA4 base tag → Event Name: generate_lead → Trigger: gform_submit.
Meta Pixel Lead event → Custom HTML tag → fbq('track', 'Lead'); → Trigger: gform_submit.
Google Ads Conversion → Google Ads Conversion Tracking template → paste Conversion ID + Label from Google Ads → Trigger: gform_submit.
Submit and Publish GTM container.
Step 3
WPForms emits a wpformsAjaxSubmitSuccess event. Capture it with a similar GTM data-layer push.
GTM → Tags → New → Custom HTML. Paste: <script>document.addEventListener('wpformsAjaxSubmitSuccess', function(event){ var formId = event.detail.formId; window.dataLayer = window.dataLayer || []; dataLayer.push({event:'wpforms_submit', formId: formId}); });</script>
Trigger → All Pages. Save.
GTM → Triggers → Custom Event with event name wpforms_submit.
Add the GA4 event tag, Meta Pixel Lead tag, and Google Ads conversion tag — all firing on wpforms_submit trigger.
Submit + Publish.
Test in GTM Preview mode → submit a test form → confirm wpforms_submit event appears in the debug pane → confirm all three tags fire.
Step 4
Contact Form 7 emits wpcf7mailsent DOM event on successful submission. Use it as a GTM trigger.
GTM → Tags → New → Custom HTML. Paste: <script>document.addEventListener('wpcf7mailsent', function(event){ window.dataLayer = window.dataLayer || []; dataLayer.push({event:'cf7_submit', formId: event.detail.contactFormId}); });</script>
Trigger → All Pages. Save.
GTM → Triggers → Custom Event with event name cf7_submit.
Add GA4 event tag, Meta Pixel Lead tag, Google Ads conversion tag — all firing on cf7_submit.
Note: Contact Form 7 also fires wpcf7invalid, wpcf7spam, wpcf7mailfailed events. You can capture these for diagnostic reasons but they do not represent successful leads.
Submit + Publish GTM. Test in Preview.
Step 5
GTM Preview mode + GA4 Realtime + Meta Events Manager Test Events + Google Ads Tag Assistant. All four should show the conversion within 60 seconds.
Open GTM in Preview mode → enter your site URL → Connect.
On the live site (in the debug session), submit a test form with valid data.
GTM Preview debug pane: confirm your custom event (gform_submit / wpforms_submit / cf7_submit) appears AND all three downstream tags fired (GA4 event, Meta Pixel Lead, Google Ads conversion).
GA4 → Reports → Realtime → event count should tick up for generate_lead event within 30-60 seconds.
Meta Events Manager → Test Events → enter your site URL → submit the test form → Lead event appears in the event stream.
Google Ads → Goals → Conversions → after 3-24 hours, the test conversion should appear (Google Ads has higher latency than GA4).
If any step fails, the GTM Preview debug pane shows which tag failed and why.
Step 6
Without spam filtering, every spam form submission counts as a conversion. Combine reCAPTCHA, honeypot, and event_label filtering in GA4.
Form plugin level: enable Google reCAPTCHA v3 (invisible, scores submissions 0-1) or a honeypot field. Gravity Forms and WPForms have built-in options. Contact Form 7 supports reCAPTCHA via Contact Form 7 Settings → reCAPTCHA.
GA4 level: in your generate_lead event, pass an event parameter for the form ID. Inside GA4 Admin → Custom definitions, register the parameter. You can then exclude known spam-prone forms from conversion reporting.
Threshold rule: a single email submitting 5+ leads in 1 hour is almost always spam. GA4 alone cannot deduplicate by email — your CRM (HubSpot, Klaviyo) can. Filter the spam in CRM, sync clean lead count back to GA4 via Measurement Protocol if needed.
Without spam filtering, your conversion data is inflated by 5-30% depending on your form's prominence.
Step 7
Capture the UTM source/medium/campaign that drove the visitor, store it as hidden fields on the form, sync to CRM and GA4 for closed-loop attribution.
Install the Hidden Fields feature in your form plugin (Gravity Forms: native; WPForms: pro version; Contact Form 7: requires CF7 + custom JS).
Add hidden fields for: utm_source, utm_medium, utm_campaign, utm_content, utm_term. Pre-populate each from the URL query string via the form plugin's dynamic-population feature.
On form submit, these fields go to your CRM along with the lead data. You can attribute every lead to its acquisition source for closed-loop ROI.
In GA4, the source is already known via the session. UTM capture is most valuable for the CRM/downstream view.
Test: visit your site with ?utm_source=test_source&utm_medium=test_medium. Submit the form. Verify the values appear in your CRM lead record.
Common mistakes
Tracking on thank-you pageview when form uses AJAX
What goes wrong: Modern forms (Gravity Forms, WPForms default) submit via AJAX with no page reload. A 'thank-you pageview' trigger never fires. Result: zero tracked conversions despite working forms.
How to avoid: Either reconfigure the form to redirect to a thank-you URL, or use the JavaScript event triggers (gform_confirmation_loaded, wpformsAjaxSubmitSuccess, wpcf7mailsent) as documented above.
Firing on the wrong Contact Form 7 event
What goes wrong: Common error: triggering on wpcf7submit (the submit attempt) instead of wpcf7mailsent (successful submission). Failed/spam/invalid submissions count as conversions.
How to avoid: Always use wpcf7mailsent. The other events (wpcf7invalid, wpcf7spam, wpcf7mailfailed) represent failures — track separately if needed but do not count as conversions.
No spam filtering on the form
What goes wrong: Spam form submissions count as conversions. Smart Bidding optimizes toward attracting more spam. Quality of real leads drops as budget shifts to spammy keyword/audience combinations.
How to avoid: Enable reCAPTCHA v3 or honeypot. Set the spam threshold conservatively. Monitor lead quality monthly — spike in junk leads usually means spam protection broke.
Tracking only GA4, missing Meta Pixel and Google Ads tags
What goes wrong: GA4 shows leads, but Meta Ads Manager says zero and Google Ads says zero. Smart Bidding has no signal. Campaigns underperform invisibly.
How to avoid: Every form-submit trigger should fire ALL relevant tags: GA4 event, Meta Pixel Lead, Google Ads conversion, LinkedIn Insight if applicable. One trigger, multiple tags.
No UTM capture in form submissions
What goes wrong: Your CRM has 500 new leads. You have no idea which came from which campaign. Marketing performance reports are based on guesswork. Cannot calculate true CAC per channel.
How to avoid: Hidden UTM fields (utm_source/medium/campaign/content/term) pre-populated from URL query string. Sync to CRM. Build attribution reports from there.
Tracking total submissions but not per-form conversion rate
What goes wrong: All forms tracked as one event = no insight into which form converts best. You optimize blind — adding form fields to the form that's converting fine, ignoring the form that's leaking.
How to avoid: Pass form ID as an event parameter. In GA4, register the parameter as a custom dimension. Build reports filtered by form ID.
Recap
Done — what's next
How to install Google Tag Manager on WordPress correctly
Read the next tutorial
Hand it off
Form tracking is one of those tasks that looks easy but breaks in non-obvious ways. A vetted analytics specialist wires Gravity Forms / WPForms / Contact Form 7 with GA4 + Meta + Google Ads tracking + UTM capture + spam filtering in one 2-3 hour session — typically $50-100 at $14-16/hr. Worth it if every form lead matters.
See specialist rates
Usually the CRM is right. GA4 counts triggered events (which can include spam, double-clicks, test submissions). CRM is the source of truth for actual leads. Spam filtering and event_label filtering bring GA4 closer to CRM, but expect ~5-10% gap.
Yes if you imported the conversion from GA4. Conversion Linker preserves the GCLID across the visit, ensuring the form submit can be attributed to the original Google Ads click. Without it, attribution breaks for users who navigate around before submitting.
Embedded forms (HubSpot embed, Mailchimp embed, Klaviyo signup form) usually emit their own JS events. HubSpot: listen for window.hsForms. Mailchimp: listen for window.mc_form_submitted. Klaviyo: listen for klaviyoForms.submit. Same pattern as the native form plugins.
No. Track the forms that represent revenue (lead, demo, signup, purchase). Newsletter signups can be tracked as a separate non-conversion event. Login forms, password resets — do not track.
Fire intermediate events on step transitions (step_2_complete, step_3_complete). Fire the final conversion event only on the last step. This lets you see drop-off rate per step in GA4 Funnel reports.
reCAPTCHA v3 is invisible to most users — no friction added. Conversion rate impact is typically <1%. Real conversion-rate killer is reCAPTCHA v2 (the checkbox or image challenge) — only use v2 if v3 is letting too much spam through.
WordPress
Most WordPress GTM installs are wrong in subtle ways — snippet in the wrong position, missing <noscript> tag, or hardcoded into a theme that updates monthly. This walks through the install that actually survives.
WordPress
There are three valid ways to install GA4 on WordPress, and the "easy" one is usually the wrong one. This walks through GTM (preferred), MonsterInsights (plugin-driven), and direct gtag.js — and how to tell which fits your stack.
WordPress
Meta Pixel install on WordPress is easy in one sense and treacherous in another — there are three valid paths and they don't play well together. This is the decision framework + the install + the verification that 60% of DIYers skip.
WordPress
WordPress is the easiest CMS to start with and the easiest to make a mess of by month 18. This is the honest framework for when DIY becomes the bottleneck and a specialist pays for themselves.