Skip to content
FunnelGuard

Fix guide by FunnelsGuard

GA4 events lost on redirect: how to flush hits before navigation

TRK-071High impactDetectedBy FunnelGuardPublished Updated
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.

Where the event disappears
  1. Visitor submits formSubmit handler runs
  2. Event queuedgenerate_lead waits to be sent
  3. Page redirectsNavigation starts before the hit leaves
  4. GA4 request cancelledBrowser drops the pending hit
  5. Lead missing in GA4No conversion recorded

The event is queued, the page redirects first, and the request is cancelled.

Form submits vs recorded leadsExample numbers
Form submits vs recorded leads (example)Real submits: 100 leads; GA4 leads (broken): 68 leads; GA4 leads (fixed): 99 leads038771006899Real submitsGA4 leads (broken)GA4 leads (fixed)leads

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

Check for cancelled hits
  1. Open DevTools on the form page

    In Chrome press F12, open the Network tab and tick Preserve log so requests survive the redirect.

  2. Filter for GA4 hits

    Type collect in the filter box. GA4 hits go to a URL containing /g/collect.

  3. Submit a test lead

    Use a test email. Watch for a request with en=generate_lead (or your event name).

  4. 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.

  5. Repeat with throttling

    Set the Network throttle to Slow 4G and submit again. Timing bugs often show up only on slower connections.

  6. 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: send with beaconjavascript
gtag('event', 'generate_lead', {
  form_id: 'contact',
  transport_type: 'beacon'
});
gtag: wait for the callback, with a fallbackjavascript
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);
});
Fix by platform
  1. 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.

  2. Or push a dataLayer event earlier

    Have your code push a custom event such as lead_submit before the redirect, and trigger the GA4 event tag from that Custom Event trigger.

  3. Test in Preview

    Open Tag Assistant preview, submit the form and confirm the GA4 tag shows as Fired before the next page loads.

Submit handler before and after

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

Confirmation checks
  • With Preserve log on, the /g/collect request 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.

How a timing change breaks tracking
  1. Day 1

    Form shows an on-page thank-you message. Events send fine.

  2. Day 10

    Someone switches the form to redirect to a thank-you URL.

  3. Day 11

    Some hits are cancelled. Leads in GA4 drop below real leads.

  4. 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 hit that never leaves

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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: missing hit on submit step.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.