GA4 for WordPress: Practical Conversion Tracking for B2B Lead Forms
If you run a B2B WordPress site and need to measure lead submissions, demo requests, or quote inquiries accurately in Google Analytics 4 (GA4), this guide walks you through event setup, consent handling, and verification—no guesswork.

Why GA4 Matters for B2B
Business impact first
Accurate conversion data tells you which traffic sources, campaigns, and pages drive actual leads. GA4’s event-based model lets you track form submissions, file downloads, and custom interactions that matter for your sales pipeline. For B2B sites especially, knowing which blog posts or product pages generate quote requests helps you optimize content and ad spend.
GA4 replaces Universal Analytics (which sunsetted in 2023). If you’re still on UA or haven’t migrated, now is the time. GA4 provides better cross-device tracking, privacy controls via Consent Mode v2, and flexible custom dimensions. See Google’s migration guide for background.
Event Model Basics
How GA4 thinks about interactions
In GA4, everything is an event. Page views are events, form submissions are events, clicks are events. You define custom events with parameters to capture the details you care about (form name, lead type, product interest). This flexibility means you can track quote requests, PDF downloads, and video plays without complex goal funnels.
For lead forms, you’ll typically fire a generate_lead event (a recommended GA4 event name) with parameters like form_name, form_location, and value. GA4 will then let you build conversion funnels and attribution reports around these events.
Step-by-Step Setup
1. Create a GA4 property
In Google Analytics Admin, create a new GA4 property if you haven’t already. Note your Measurement ID (format: G-XXXXXXXXXX). This ID is what you’ll add to your WordPress site.
2. Install the GA4 tag on WordPress
Use a plugin like Site Kit by Google or MonsterInsights for easy integration, or manually add the GA4 global site tag (gtag.js) to your theme’s header. The global tag loads on every page and sends basic page view events automatically.
Example manual snippet (add to header.php or via a custom HTML widget in wp-admin):
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
Replace G-XXXXXXXXXX with your actual Measurement ID. This establishes the base tracking.
3. Track form submissions as events
When a user submits a lead form, fire the generate_lead event. You can do this via JavaScript on form submit, or use a form plugin that supports GA4 events (many do as of 2026). Example inline script:
document.querySelector('#contact-form').addEventListener('submit', function(e) {
gtag('event', 'generate_lead', {
'form_name': 'Contact Form',
'form_location': 'Contact Page',
'value': 1.00, // optional: assign a lead value if known
'currency': 'USD'
});
});
This snippet fires the event when the form with ID #contact-form is submitted. Adjust selectors and parameters to match your forms. For multiple forms, add unique identifiers so you can segment by form name in reports.
4. Mark events as conversions in GA4
In GA4 Admin → Events, find generate_lead in the event list and toggle “Mark as conversion.” This tells GA4 that this event represents a valuable action. You can then see conversion counts, conversion rate, and attribution paths in the GA4 interface.
5. Verify data flow
Use GA4’s Realtime report to test. Submit a form on your site and watch for the generate_lead event to appear in Realtime within seconds. Check that parameters (form_name, etc.) are captured correctly. If you don’t see events, double-check your Measurement ID, script placement, and any ad blockers in your test browser.
Consent Mode v2 Integration
Privacy-friendly tracking
Consent Mode v2 lets GA4 respect user consent choices while still providing aggregated insights. If a user opts out of analytics cookies, GA4 switches to cookieless pings that don’t store identifiers but still record basic engagement. This helps you stay compliant with General Data Protection Regulation (GDPR) and similar regulations.
To enable Consent Mode, integrate a Consent Management Platform (CMP) like OneTrust, Cookiebot, or a lightweight WordPress plugin. Configure the CMP to send consent signals to gtag before GA4 initializes. Example consent setup:
gtag('consent', 'default', {
'analytics_storage': 'denied',
'ad_storage': 'denied'
});
// Update consent when user accepts
gtag('consent', 'update', {
'analytics_storage': 'granted'
});
See Google’s Consent Mode guide for full implementation details. This ensures your tracking is both effective and compliant.
Custom Dimensions & Parameters
Tagging for richer insights
GA4 lets you define custom dimensions (user-scoped or event-scoped) to capture business-specific data. For B2B, you might track:
- Lead type: “demo,” “quote,” “whitepaper download”
- Product interest: which product or service the lead relates to
- Customer Relationship Management (CRM) ID: if you sync leads to a CRM, pass the lead ID for later join
Define these in GA4 Admin → Custom Definitions, then include them as event parameters in your gtag calls. This lets you segment reports by lead type and understand which content drives high-value demo requests vs. general inquiries.
Troubleshooting Common Issues
What to do when events don’t show up
- Ad blockers: Test in an incognito window or with blockers disabled.
- Caching: Clear WordPress and Cloudflare cache after adding scripts.
- Tag placement: Ensure gtag.js loads before your event triggers fire.
- Measurement ID typo: Double-check the G-XXXXXXXXXX ID matches your property.
Use the GA4 DebugView (enable via browser extension or debug_mode parameter) to see events in real-time with full parameter details. This is invaluable for diagnosing setup issues.
Business Impact & Next Steps
From data to decisions
With accurate lead tracking, you can:
- Identify top-performing traffic sources and campaigns.
- Optimize landing pages based on conversion rates.
- Justify marketing spend with clear return on investment (ROI) data.
- Feed lead data into CRM workflows for sales follow-up.
For ongoing optimization, monitor weekly conversion trends, test form placements, and refine your content strategy based on what drives real leads. GA4’s flexible reporting supports these insights without requiring constant re-tagging.
Key Takeaways
- GA4’s event model tracks form submissions as
generate_leadevents with custom parameters. - Use Consent Mode v2 for privacy-friendly tracking that respects user choices.
- Verify setup with Realtime reports and DebugView; mark events as conversions in GA4 Admin.
