Library·SOP·Analytics

Track lead form submissions using a thank-you page in GA4

Use Google Analytics 4 (GA4) to count visits to the thank-you page shown after a lead form is submitted. Create a generate\_lead event and mark it as a key event, an action important to your business. This method counts thank-you page visits, not unique leads.

Last reviewed: · Editorial review

Clarity, structure and references reviewed in this version. This is not a test in a live account.

SOP 015 · 30 min
SOPFree

Track lead form submissions using a thank-you page in GA4

SOP 015 · 30 min

Use Google Analytics 4 (GA4) to count visits to the thank-you page shown after a lead form is submitted. Create a generate_lead event and mark it as a key event, an action important to your business. This method counts thank-you page visits, not unique leads.

Scope

This SOP covers:

This does not cover:

Requirements

01. Check the form and existing measurement

First prove that the page represents an accepted submission and that GA4 can receive activity from the site.

  1. In the tool that manages the form, open its saved-submissions list (often named Entries or Submissions). Try submitting the form with a required field empty and confirm it stays on the form. Then submit valid details, confirm the saved submission appears in the list, and copy the final thank-you-page URL from the address bar. It must match the fixed URL in your prerequisites.

    • Warning: Use a page reserved for this form’s success. A page reachable through ordinary navigation can count visits that were never leads. Reloads and direct visits to the success URL can also count again.
  2. Open Google Analytics, select the property matching your property ID, and open Reports → Realtime overview. In a normal browser tab, open the form page again. In Event count by Event name, open page_view, then page_location—GA4’s field for the full page URL, including its protocol, domain, path and any query string. Look for the form-page URL from this visit. Continue only after the new visit is received.

  3. Open Admin → Data display → Events. Check both Key events and Recent events for generate_lead. Then open Custom configurations → Custom events for your website stream and inspect its rules. Continue only if generate_lead is not already collected or configured.

    • Warning: If generate_lead already exists, stop here. Adding a second rule can double-count leads; its existing setup needs a separate review.

02. Create the lead key event

Create a new event for the exact success URL while keeping ordinary page views unchanged.

  1. Return to Events and click Create event. Enter generate_lead as the event name and turn on Mark as key event. Choose Once per event for the counting method and Don’t set a default key event value for the default value.

  2. Choose Create without code, select your website stream, and use page_view as the source event. Enter the thank-you-page URL from step 1.1. Click View more options. Set the two matching conditions to event_name — equals — page_view and page_location — equals — your full thank-you-page URL. Enable Copy parameters from the source event, then click Save to return to the event setup.

    • Warning: Use equals, not contains. The protocol, domain, path and trailing slash must match the actual URL. A different query string will not match this fixed-URL rule.
  3. Click Create. Open Custom configurations → Custom events for the same stream, then reopen generate_lead. Check the saved name, both matching conditions and Copy parameters from the source event.

  4. Return to the Key events tab and find generate_lead. Confirm it is marked as a key event. Open its action menu and inspect Change counting method and Set default key event value. Confirm the saved choices are Once per event and no default monetary value.

03. Check a new submission in Realtime

Use a normal test visit that is not excluded by an active internal-traffic filter. After the successful-submission check, reload or directly revisit the thank-you page once and record the additional event as a known limitation of this method. If the business needs one event per accepted submission, do not present this page-view implementation as unique-lead tracking; hand off to a form-success integration. Keep test submissions identified in the form system for reconciliation.

First, wait at least one hour after saving the new configuration before testing. Google says changes can take an hour or more to become available, so wait longer if checks are incomplete. After a test submission, allow a few minutes for its Realtime receipt. The 30-minute work estimate excludes the initial wait.

  1. Check that a rejected form attempt does not produce a lead key event.

    1. After the one-hour activation wait in this milestone, choose a quiet period with no submissions and no generate_lead events in the previous 30 minutes. Open Reports → Realtime overview and confirm generate_lead is absent from both the event-count and key-event cards.

      • Warning: If someone else submits the form while you are testing, restart during a quiet period.
    2. Open the form in a normal browser tab without a debugging session. Try submitting it with a required field empty. Confirm it stays on the form page.

    3. In Realtime, find the new page_view and open page_location to confirm it shows the form-page URL. Confirm generate_lead is still absent from both cards.

  2. Within the same 30-minute window, submit valid details once and confirm the saved submission appears in the form tool’s Entries or Submissions list and the form loads the exact thank-you-page URL. Do not reload it. After a few minutes, in Realtime open generate_lead under Event count by Event name, then inspect page_location for that thank-you-page URL. Check that Key events by Event name also records generate_lead. With no other submissions since your zero baseline, both cards should show one occurrence.

    • Warning: If the event or key-event receipt is missing, this check is incomplete. Allow configuration time and repeat the check later; do not add another rule to force a result.