Technology, software and IT support for businesses in the USA, UK, Canada, Australia, UAE and India.

How to track leads in GA4 with Google Tag Manager

A step-by-step tutorial for measuring form enquiries, calls and other leads as key events in Google Analytics 4 using Google Tag Manager and the data layer — with consent and testing.

Published
Last reviewed

Key takeaways

  • Decide what counts as a lead before configuring tools: forms, calls, WhatsApp clicks, bookings.
  • Push a structured event to the data layer when a lead actually succeeds, rather than tracking button clicks.
  • In Google Tag Manager, a custom event trigger fires a GA4 event tag, which sends the event with parameters.
  • In GA4, mark the event as a key event (GA4’s name for conversions since 2024) and import it into Google Ads if you advertise.
  • Respect consent requirements and always test in preview and DebugView before publishing.

This tutorial shows how to measure leads — form enquiries, phone calls, WhatsApp clicks and bookings — as key events in Google Analytics 4 (GA4) using Google Tag Manager (GTM). It is written for marketers and developers working together on a business website.

Before you start: you need edit access to the website (or a developer), publish access to a GTM container, and Editor access to the GA4 property.

Step 1: Define what a lead is

List the actions that represent genuine business interest and agree names for them. For example:

ActionEvent nameUseful parameters
Contact or project form sent successfullygenerate_leadform_name, service, page_location
Click on a phone numberclick_to_calllink_url, page_location
Click on a WhatsApp linkclick_to_whatsapppage_location
Booking confirmedbook_appointmentservice
Form startedform_startform_name

generate_lead is one of GA4's recommended event names. Using recommended names where they fit makes reports easier to understand and compatible with future features.

Step 2: Push an event to the data layer on success

The most reliable way to track a form is to fire an event only after the server confirms the submission. Ask your developer to add a data layer push on the success state — for example on the thank-you message or after a successful AJAX response:

window.dataLayer = window.dataLayer || []; dataLayer.push({ event: 'generate_lead', form_name: 'contact', service: 'cloud-solutions' });

Never include personal information such as names, email addresses or phone numbers in the data layer values sent to analytics.

DigiModeler's WordPress theme, for example, pushes generate_lead when an enquiry is saved, form_start when a visitor begins a form, and cta_click for important buttons, so these events are ready to use in GTM.

Step 3: Install Google Tag Manager and the Google tag

  1. Create a GTM container for the website and add the container snippet to every page (or set the container ID in your theme or plugin settings).
  2. In GTM, create a Google tag with your GA4 measurement ID (starting G-) and trigger it on Initialization – All Pages (or All Pages).
  3. Avoid installing GA4 twice — for example once in GTM and again with a plugin — as this double-counts data.

Step 4: Create the trigger and the GA4 event tag

  1. Variables: create Data Layer Variables for form_name and service.
  2. Trigger: create a Custom Event trigger with the event name generate_lead.
  3. Tag: create a Google Analytics: GA4 Event tag with the settings below.
  • Measurement ID: your G- ID (or reference the Google tag).
  • Event name: generate_lead.
  • Event parameters: form_name → {{DLV - form_name}}, service → {{DLV - service}}.
  • Trigger: the custom event trigger from the previous step.

For phone and WhatsApp clicks, use Click – Just Links triggers with conditions such as Click URL starts with tel: or Click URL contains wa.me.

In many regions — including the UK and European Economic Area — analytics and advertising cookies require consent. Google's consent mode lets tags adjust their behaviour according to the visitor's choices. Configure your consent banner or consent management platform to set default consent states before tags fire and update them when the visitor chooses. Legal requirements vary by country; check with your adviser which consent model applies to you.

Step 6: Test before publishing

  1. Use GTM Preview mode (Tag Assistant) and submit a test enquiry.
  2. Confirm the generate_lead custom event appears and your GA4 event tag fired once.
  3. In GA4, open Admin → DebugView and check the event and its parameters arrive.
  4. Test failure cases: a form with validation errors should not send generate_lead.
  5. Publish the GTM container with a clear version name.

Step 7: Mark the event as a key event in GA4

After the event has been received, go to Admin → Events (or Admin → Key events) and mark generate_lead as a key event. GA4 renamed "conversions" to "key events" in 2024. Key events then appear in acquisition and engagement reports.

If you register custom parameters such as service as custom dimensions (Admin → Custom definitions), you can report leads by service.

Step 8: Use key events in Google Ads

If you run Google Ads, link the GA4 property to your Google Ads account and import the key event as a conversion — or use a Google Ads conversion tag in GTM. Choose one primary source for bidding to avoid counting the same lead twice.

Step 9: Report on what matters

  • Leads by channel, campaign and landing page.
  • Lead rate (key events ÷ sessions) by page template.
  • Leads by service and country, using custom dimensions.
  • Trends after website or campaign changes.

Compare GA4 numbers with your CRM regularly. Differences are normal; large unexplained gaps usually indicate tracking or spam problems.

Common mistakes

  • Tracking button clicks instead of successful submissions.
  • Sending personal data to analytics.
  • Installing GA4 in two places, doubling every event.
  • Forgetting consent configuration.
  • Marking too many events as key events, which dilutes reporting.
  • Never re-testing after website changes.

Need help?

DigiModeler's digital marketing team sets up GA4, Google Tag Manager, consent and lead reporting, and connects them to CRM systems. See also our page on digital marketing in Indore and the technical SEO guide.

Frequently asked questions

What happened to “conversions” in GA4?

In 2024 Google renamed conversions in GA4 to “key events”. Google Ads continues to use the term conversions, and key events can be imported into Google Ads as conversions.

Why not track clicks on the submit button?

A click does not mean the form was sent successfully — validation errors and spam checks can stop it. Firing the event after a successful submission gives more accurate lead numbers.

Do I need Google Tag Manager?

Not strictly; you can send events with the Google tag in code. GTM makes it easier to manage tags, triggers and consent without editing the website for every change.

Can I send personal data such as email addresses to GA4?

No. Google Analytics policies prohibit sending personally identifiable information. Send non-personal parameters such as form name, service or page location.

Why don’t GA4 numbers match my CRM?

Consent choices, ad blockers, browser privacy features, spam filtering and attribution rules all create differences. Use the CRM as the record of leads and GA4 for trends and channel analysis.

References

  1. Mark events as key events Google Analytics Help
  2. Recommended events Google Analytics Help
  3. Events reference: generate_lead Google for Developers
  4. The data layer Google for Developers
  5. Set up consent mode on websites Google for Developers

External links open in a new tab. Product names are trademarks of their respective owners.

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep reading

Related articles

Web & Mobile Development 4 min

Core Web Vitals explained: LCP, INP and CLS

Core Web Vitals measure how fast a page loads its main content, how quickly it responds to interaction and how stable its layout is. Learn the thresholds, how to measure them and the most common fixes.

Start with a clear picture of your IT and systems.

Tell us what you’re working on, or request a technology consultation. We’ll review it and recommend practical next steps.