How to Set Up Google Analytics 4 Conversion Tracking for Lead Forms on a Business Website
If you run a business website with a contact form, a quote request, or a demo booking button, you probably want to know which visitors actually turn into enquiries. Google Analytics 4 can answer that question, but only after you tell it what counts as a lead. By default, GA4 records page views, scrolls, and clicks, and none of those automatically mean a form was submitted. Setting up conversion tracking for lead forms is the step that connects your website activity to real business outcomes, such as which pages, campaigns, and traffic sources are producing enquiries.
The short answer is this: fire a GA4 event when a form is successfully submitted, mark that event as a key event (GA4's newer term for what used to be called a conversion), and then verify that it arrives in your reports. The rest of this article explains how to do each step, what can go wrong, and how to keep the data trustworthy over time.
What GA4 Tracks by Default and Why It Is Not Enough
GA4 is event-based. Every interaction, from a page load to a file download, is recorded as an event with a name and optional parameters. Some events are collected automatically, such as page_view, scroll, and file_download. Others, including form-related events, depend on how your site is built.
A common mistake is assuming that because a visitor reached a "Thank you" page, the lead was tracked. That only works if the thank-you page is a dedicated URL that you have configured as a conversion. It breaks down when the form submits through AJAX and the page never reloads, when visitors bookmark or revisit the thank-you URL, or when several forms redirect to the same page. A cleaner approach is to send an explicit event at the moment of successful submission.
Decide What Counts as a Lead Before You Touch the Code
Before setting anything up, agree on the definition of a lead for your business. Some questions to settle:
- Is a lead any form submission, or only submissions that pass validation and reach your inbox or CRM?
- Do you have multiple forms (contact, quote, newsletter, careers) that should be tracked separately?
- Do you want to distinguish between a form start and a completed submission?
- Will spam submissions be filtered out, and if so, how?
Write these decisions down. Tracking that is ambiguous at the start becomes impossible to interpret later. A useful pattern is to track one primary event called something like generate_lead for completed submissions, and optionally a secondary event such as form_start for visitors who begin filling in a form. Google's recommended events list includes generate_lead, which makes it a sensible name to reuse, since GA4 reports and some integrations recognise it.
Method 1: Using Google Tag Manager
For most business websites, Google Tag Manager (GTM) is the most manageable route. It keeps tracking code out of your site's templates and lets you change events without a developer redeploying the site each time.
Prerequisites
- A GA4 property and its Measurement ID (format
G-XXXXXXXXXX). - A GTM container installed on every page of your site.
- Access to your form's technical behaviour: does it reload the page, redirect to a thank-you URL, or show an inline message?
Step-by-step: a thank-you page trigger
If your form redirects to a confirmation URL such as /thank-you/, this is the simplest setup.
- In GTM, create a GA4 Configuration tag using your Measurement ID and set it to fire on All Pages.
- Create a GA4 Event tag. Name the event
generate_lead. - Create a trigger of type Page View, set to fire when the Page Path equals
/thank-you/. Use the exact path your site uses. - Attach this trigger to the GA4 Event tag and save.
- Click Preview, enter your website URL, submit the form, and confirm that the
generate_leadevent appears in the debug panel. - Publish the container version.
The weakness of this approach is that it counts visits to the thank-you page, not submissions. If the page is reached in other ways, the count will be inflated. You can reduce this by using a unique confirmation URL that is only reachable after a successful submit, or by moving to the event-based method below.
Step-by-step: a form submission event
If your form submits without leaving the page, or you want a more accurate count, use a custom event. This requires that your site pushes a message to the GTM data layer on successful submission. Your developer adds a line such as:
window.dataLayer = window.dataLayer || []; window.dataLayer.push({'event': 'lead_form_submitted', 'form_name': 'contact'});
Then, in GTM:
- Create a Custom Event trigger with the event name
lead_form_submitted. - Create a GA4 Event tag named
generate_lead, attached to that trigger. - Optionally add an event parameter
form_namethat reads the Data Layer Variableform_name. This lets you separate contact, quote, and demo forms in reports. - Test in Preview mode and publish.
Pushing the event only after the server confirms success (for example, after the response is received without errors) is more accurate than pushing it on the submit button click. A click does not guarantee that the form was valid or delivered.
Method 2: Direct Tagging Without Tag Manager
If your site is small and you do not use GTM, you can send the event directly with the gtag.js library. On a form that submits via JavaScript, call the gtag function once the submission succeeds:
gtag('event', 'generate_lead', { 'form_name': 'contact' });
This assumes the GA4 base tag is already installed on the page. The downside is maintenance: every form change requires editing site code, and mistakes are harder to spot. For anything beyond a single form, GTM is usually easier to manage.
Marking the Event as a Key Event
Sending an event is not enough on its own. GA4 reports only treat an event as a conversion once you mark it. In the GA4 interface, go to Admin, then under Data display choose Events. Find generate_lead in the list. After it has been received at least once, a toggle appears. Switch on "Mark as key event."
Note that the event must have fired at least once after setup before it appears in this list. If it is missing, check that the event is actually arriving (see the verification section below). Also keep in mind that Google may apply its own processing to events, so allow time for data to appear in standard reports. Realtime reports are the fastest way to confirm an event is arriving.
Passing Useful Parameters
An event that only says "a lead happened" is less useful than one that says where it came from. Cons
