Home/Blog/GA4 Implementation
GA4 Implementation8 min read

How to Track Form Submissions in GA4: 3 Methods (GTM, gtag, Enhanced)

Step-by-step guide to tracking form submissions in GA4 using Google Tag Manager, gtag.js, and enhanced measurement. Includes dataLayer code examples.

GA4, form tracking, GTM, conversions, lead generation

Form submissions are the most important conversion event for lead generation sites, yet they are the most commonly misconfigured event in GA4.

Method 1: Enhanced Measurement (Basic)

GA4 has built-in form interaction tracking via enhanced measurement:

  1. Admin > Data Streams > your stream > Enhanced measurement
  2. Enable "Form interactions"

This fires a form_submit event when a form is submitted. However, it has significant limitations: - It only detects standard HTML

submissions - It does not work with JavaScript-based forms (React, AJAX submissions) - It does not capture which form was submitted - It triggers on ALL forms, including search bars

Verdict: Fine for basic sites. Not reliable for SaaS or multi-form pages.

Method 2: Google Tag Manager (Recommended)

GTM gives you full control over which forms are tracked and what data is captured.

Step 1: Create a Form Submission Trigger

  1. In GTM, go to Triggers > New
  2. Trigger type: Form Submission
  3. Configure:
  4. - Check "Wait for Tags" (ensures GA4 fires before page navigates)
  5. - Check "Check Validation" (only fires on valid submissions)
  6. - Fire on: Some Forms > Form ID contains `contact` (or your form's ID)

Step 2: Create a GA4 Event Tag

  1. Tags > New > GA4 Event
  2. Configuration tag: your GA4 config tag
  3. Event name: `generate_lead`
  4. Event parameters:
  5. - `form_id`: `{{Form ID}}`
  6. - `form_name`: `Contact Form` (or use a lookup table variable)
  7. - `value`: `50`
  8. - `currency`: `USD`
  9. Trigger: the form submission trigger you created

Step 3: For AJAX/JavaScript Forms

If your form submits via JavaScript (React, fetch, XMLHttpRequest), the GTM Form Submission trigger will not work. Use a custom event instead:

In your form's success handler: `javascript // After successful form submission dataLayer.push({ event: 'generate_lead', form_id: 'contact_form', form_name: 'Contact Us', value: 50, currency: 'USD' }); `

In GTM: 1. Create a Custom Event trigger matching generate_lead 2. Create a GA4 Event tag firing on this trigger

Method 3: gtag.js Direct

If you do not use GTM, fire the event directly from your form handler:

document.getElementById('contact-form').addEventListener('submit', function(e) {
  gtag('event', 'generate_lead', {
    form_id: 'contact_form',
    form_name: 'Contact Us',
    value: 50,
    currency: 'USD'
  });
});
javascript

For async form submissions (fetch/AJAX): `javascript async function handleSubmit(formData) { const response = await fetch('/api/contact', { method: 'POST', body: formData });

if (response.ok) { gtag('event', 'generate_lead', { form_id: 'contact_form', form_name: 'Contact Us', value: 50, currency: 'USD' }); } } `

Marking as a Key Event

After your form event is firing correctly:

  1. Go to GA4 Admin > Key events
  2. Click "New key event"
  3. Enter `generate_lead`
  4. Set counting method to "Once per session" (prevent duplicate conversions)

Testing Your Form Tracking

  1. Enable GTM Preview mode or GA4 debug mode
  2. Fill out and submit the form
  3. Check GA4 DebugView for the `generate_lead` event
  4. Verify all parameters are present (form_id, value, currency)
  5. Check that it appears in Realtime > Key events

Common Pitfalls

1. Thank-you page tracking instead of event tracking. Some setups track a destination URL (/thank-you) instead of the form event. This breaks if users bookmark the thank-you page or access it directly.

2. No form identification. If you have 3 forms on your site and all fire generate_lead without a form_id parameter, you cannot tell which form generated the lead.

3. Double tracking. Enhanced measurement form_submit AND your custom generate_lead both firing. Disable enhanced measurement form tracking if you have custom tracking.

Not sure if your form tracking is working? Audit your GA4 setup →

Check your GA4 implementation

Run a free AI-powered audit to see how your tracking stacks up.

Start Free Audit