By GA4 Setup Agency. Updated 28 November 2026. Filed under Conversion Tracking.
A lead should be counted when the form succeeds, not when someone presses the button.
Choose the success signal
- Thank you page: simple and reliable if visitors can only reach it after submitting.
- Plugin or script event: many AJAX forms announce success. Contact Form 7, for instance, dispatches a
wpcf7mailsentDOM event. - Embedded forms: iframe tools may need their own callback or a cross-domain message.
Push a clean event
document.addEventListener('wpcf7mailsent', function (e) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'generate_lead',
form_id: e.detail.contactFormId
});
});
Do not include names, emails or message text.
Send it onward
In Tag Manager, create a custom event trigger and use it for the GA4 event and the advertising conversions. Mark generate_lead as a key event.
Measure quality
Raw form counts include spam and poor fits. Where you can, send qualified and closed stages back from your CRM, following each platform's data terms.
Test it
- Submit with an empty required field: no event.
- Submit correctly: exactly one event.
- Reload the page: no repeat.
- Reject consent: tags behave as promised.
Phone, email and chat
Not every lead uses a form. A click on a phone or email link shows intent, but it does not prove a conversation happened. Track those clicks as separate events, and keep them secondary unless you have a good reason. Call tracking services can report connected calls where that is lawful and disclosed.
Multi-step forms
Send an event when each step is completed, with a step number, and one lead event at the end. The step events show where people leave without inflating lead totals.
Booking tools
Calendar widgets often run in an iframe. Check whether the provider offers an official integration, a redirect to your own confirmation page or a message event. Verify one completed booking produces one lead.
Spam control
Add spam protection to the form and compare event counts with real messages each month. If bots trigger conversions, ad bidding can start to chase them.
Related: Google Ads lead tracking and GA4 setup.
About the author
This guide was written and published by GA4 Setup Agency, an analytics and conversion tracking service for businesses in the USA and UK. Platform interfaces change often, so please check the linked official documentation before editing a live account.
Need help with your tracking?
Tell us what is not adding up and we will review your setup.
Get a Free Tracking Audit

