On this page
What this issue is
Tracking code does not always send an event the instant you call it. Many setups put events in a queue (a batch) and send them shortly after. Google Tag Manager (GTM) also runs tags in sequence after the trigger.
If the page navigates away in that gap, for example a form posts and redirects to a thank-you page, the browser may cancel the pending request. The event was created in the page, but it never reached GA4. In the browser's network panel it often shows as cancelled or not shown at all.
This is a timing problem, not a configuration problem. The tag, the event name and the parameters can all be correct, and the event is still lost some of the time.
Why it costs you leads or sales
The events most likely to be lost are the ones that trigger a redirect: form submits, add to cart, checkout starts and outbound clicks. These are your conversions. When they go missing, GA4 under-reports leads and ad platforms that import GA4 conversions get fewer signals to learn from.
The loss is also patchy. Fast connections may send the hit in time, slow ones may not, so your numbers drift and nobody can say why. Campaigns look worse than they are, and budget decisions follow the wrong data.
- Visitor submits formSubmit handler runs
- Event queuedgenerate_lead waits to be sent
- Page redirectsNavigation starts before the hit leaves
- GA4 request cancelledBrowser drops the pending hit
- Lead missing in GA4No conversion recorded
The event is queued, the page redirects first, and the request is cancelled.
Example: 100 real form submits in a week, with and without the redirect race. Numbers are illustrative.
How to check if your site has it
Open DevTools on the form page
In Chrome press F12, open the Network tab and tick Preserve log so requests survive the redirect.
Filter for GA4 hits
Type
collectin the filter box. GA4 hits go to a URL containing/g/collect.Submit a test lead
Use a test email. Watch for a request with
en=generate_lead(or your event name).Read the status
If the request is missing, or shows as cancelled or failed just as the thank-you page loads, the hit was lost to navigation.
Repeat with throttling
Set the Network throttle to Slow 4G and submit again. Timing bugs often show up only on slower connections.
Compare counts
Compare form entries in your CRM or inbox with GA4 events for the same days. A steady gap points to lost hits.
How to fix it
There are two reliable approaches. Use a beacon so the browser finishes sending the request after the page unloads, or wait for a callback that confirms the hit was sent before you navigate. Use a short timeout as a safety net so visitors are never stuck.
gtag('event', 'generate_lead', {
form_id: 'contact',
transport_type: 'beacon'
});document.querySelector('#lead-form').addEventListener('submit', function (e) {
e.preventDefault();
var form = this;
var done = false;
function go() {
if (done) return;
done = true;
form.submit();
}
gtag('event', 'generate_lead', {
form_id: 'contact',
event_callback: go
});
setTimeout(go, 1000);
});Fire on the right trigger
Use a Form Submission trigger with Wait for Tags enabled and a max wait time of about 2000 ms. Tick Check Validation so failed submits do not fire.
Or push a dataLayer event earlier
Have your code push a custom event such as
lead_submitbefore the redirect, and trigger the GA4 event tag from that Custom Event trigger.Test in Preview
Open Tag Assistant preview, submit the form and confirm the GA4 tag shows as Fired before the next page loads.
Find how the form redirects
Many form plugins have a setting to redirect after submit. Check whether it uses a hard redirect or a thank-you message on the same page.
Prefer on-page confirmation or AJAX
If the plugin supports an AJAX submit, fire the event on its success event, then redirect after the hit is sent.
Add the beacon option
If you add gtag code through a theme file or a code snippet plugin, include
transport_type: 'beacon'in the event.
Check the form redirect setting
In the form settings, a Redirect URL navigates right after submit. Webflow forms can show the success message instead.
Add the event in custom code
In Project Settings, Custom Code, add a submit listener using the callback pattern above, or use the beacon option.
Use the beacon option
Add
transport_type: 'beacon'to every event sent right before navigation.Delay navigation until the callback
Use
event_callbackand a timeout of around one second as a fallback, as in the example above.Avoid redirecting in the same tick
Do not call
window.locationimmediately aftergtag(). Let the event leave first.
Before
- gtag() is called, then the page redirects at once
- Request is cancelled on slower connections
- GA4 lead count is lower than real leads
After
- Event uses transport_type beacon or waits for event_callback
- A one second timeout keeps the form from hanging
- GA4 lead count matches form entries
How to confirm it's fixed
- With Preserve log on, the
/g/collectrequest for your event appears and is not cancelled - The test passes with Network throttling set to Slow 4G
- GA4 DebugView shows the event with the right parameters
- Submitting the form still redirects to the thank-you page
- Over several days, GA4 leads match your CRM or inbox entries
How to prevent it happening again
Make the pattern a rule: any event that fires right before navigation must use a beacon or wait for a callback. Add it to your code review and your GTM checklist. Re-test after every form plugin, theme or redirect change, because those changes alter the timing.
Day 1
Form shows an on-page thank-you message. Events send fine.
Day 10
Someone switches the form to redirect to a thank-you URL.
Day 11
Some hits are cancelled. Leads in GA4 drop below real leads.
Day 30
Reports are questioned. The gap is found by comparing with the CRM.
How FunnelGuard handles this
FunnelGuard detects this today. A robot visitor runs your real form journey on a schedule, submits a marked test lead, and checks the tracking hits sent at each step. If the expected hit is missing on the submit step, that is flagged as a failure.
A failure is re-checked from a second region before one alert goes out, with a screenshot and a likely cause. That matters here because the loss can be intermittent. FunnelGuard tells you the hit is missing on submit. You then use the steps above to confirm it is a redirect race and not a trigger or consent problem. The Free plan covers 1 site and 2 journeys with daily checks, no card needed.
The submit step runs, but the page navigates before the tracking request is sent.
Questions people ask
Why is my GA4 event not recorded when the page redirects?
The browser can cancel the tracking request if the page navigates before it is sent. Events are often queued and sent a moment later, so a fast redirect wins the race. Use a beacon or wait for the event callback before redirecting.
What does transport_type beacon do in gtag?
It tells gtag to send the hit using the browser's navigator.sendBeacon method. The browser then completes the request even if the page is unloading. It is the simplest fix for events fired just before a redirect.
How do I wait for a GA4 event to send before redirecting?
Pass an event_callback function in the event parameters and navigate inside it. Add a timeout of about one second as a fallback so the visitor is never stuck if the callback does not run.
Why does my generate_lead event show as cancelled in the Network tab?
A cancelled request usually means the page navigated away before the hit finished. Turn on Preserve log and test again to see it. The fix is to send the event with a beacon or to delay the redirect.
How do I stop GTM tags being lost on a form redirect?
On the Form Submission trigger, enable Wait for Tags and set a max wait time of around 2000 ms. You can also push a dataLayer event before the redirect and fire the tag from a Custom Event trigger.
Is it better to track the thank-you page instead of the submit?
Often yes. A thank-you page event has no navigation after it, so nothing cancels it. Guard it so a refresh or revisit does not count the lead twice.
Can I tell if I am losing events to redirects without checking by hand?
Compare form entries in your CRM with GA4 events for the same period. A steady gap suggests lost hits. FunnelGuard also runs your form journey on a schedule and flags a missing hit on the submit step.
Related issues
- TRK-043generate_lead not sent on form submitFix guide
- TRK-044generate_lead fires on page load instead of submitFix guide
- TRK-045Lead event fires on submit click even when validation failsFix guide
- TRK-046Conversion event fires on every page view of thank-you page (refresh)Fix guide
- TRK-065Booking confirmation event missing after Calendly/Cal.com bookingFix guide
- TRK-062Click events for WhatsApp / call not trackedFix guide