Skip to content
FunnelGuard

Fix guide by FunnelsGuard

GA4 event lost on page unload: use transport_type beacon

TRK-072High impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

GA4 sends each event as a small web request to Google. Normally the page stays open long enough for that request to finish. But if the page redirects, reloads or closes at the same moment (a form submit that loads a thank-you page, a click on an external link), the browser may cancel the request in flight.

In Chrome DevTools this shows as a collect request to google-analytics.com with a status of (canceled) or net::ERR_ABORTED. The event was fired by your tag, but Google never received it.

The fix is the beacon transport. It uses the browser's navigator.sendBeacon() method, which hands the request to the browser to finish in the background, even after the page has gone. In GA4 you request it with the transport_type parameter set to beacon.

Where the hit gets lost
  1. Visitor submits formSubmit handler runs
  2. GA4 event firesgenerate_lead request starts
  3. Page navigates awayBrowser cancels the request
  4. GA4 receives eventNothing arrives
  5. Conversion in Google AdsNever imported

The event fires, but the page unloads before the request finishes.

Why it costs you leads or sales

The lead or sale still happens, but your reports do not show it. GA4 undercounts conversions, and any Google Ads conversion imported from GA4 is undercounted too. Smart bidding then learns from incomplete data and may spend less on the campaigns that actually work.

The loss is also uneven. Fast connections and slow pages behave differently, so some browsers and devices lose more events than others. That skews channel and device comparisons without any obvious error.

Form submits vs events recordedExample numbers
Form submits vs events recorded (example)Real submits: 100 count; Recorded without beacon: 72 count; Recorded with beacon: 98 count038771007298Real submitsRecorded without beac…Recorded with beaconcount

Example: 100 real form submits in a week. Without beacon some events are cancelled; with beacon nearly all arrive.

How to check if your site has it

Check for cancelled GA4 requests
  1. Open DevTools Network

    In Chrome press F12, open the Network tab and tick Preserve log. Without it the list clears on navigation and you will miss the cancelled hit.

  2. Filter for collect

    Type collect in the filter box to show GA4 requests to /g/collect.

  3. Submit the form or click the link

    Use a test entry. Watch for the request carrying your event name (en=generate_lead, for example).

  4. Read the status

    A status of (canceled) or net::ERR_ABORTED means the page unloaded first. A status of 204 or 200 means it was sent.

  5. Compare with GA4 DebugView

    In GA4 go to Admin > DebugView. If the event is missing there while the form worked, the hit was lost.

How to fix it

The fix depends on how the event is sent. Pick the tab that matches your setup.

Send the event with the beacon transport
  1. Open the GA4 event tag

    In GTM open the GA4 Event tag that sends your lead or click event.

  2. Add the transport_type parameter

    Under Fields to Set (or Event Parameters, depending on your tag version), add a row: field name transport_type, value beacon.

  3. Check the trigger

    Use a trigger that fires as early as possible, such as a Form Submission or Click trigger, not one that waits for the next page.

  4. Preview and publish

    Test in Preview mode, check the hit in DebugView, then publish the container.

gtag event with beacon transportjavascript
document.querySelector('#lead-form').addEventListener('submit', function () {
  gtag('event', 'generate_lead', {
    form_id: 'contact',
    transport_type: 'beacon'
  });
});

How to confirm it's fixed

Confirmation checklist
  • Submit a test form with DevTools Network open and Preserve log ticked.
  • The collect request for your event is no longer shown as cancelled, or the event appears in DebugView.
  • The event shows in GA4 Admin > DebugView with the right parameters.
  • Realtime reports show the event within a few minutes.
  • Repeat in a second browser, such as Safari or Firefox, and on mobile.
  • After a day, compare GA4 event counts with form entries in your inbox or CRM.
Before and after

Without beacon

  • Event fires as the page unloads
  • Request shows (canceled)
  • Event missing in DebugView
  • GA4 and Ads count fewer leads than you got

With beacon

  • Event is handed to the browser to finish
  • Request completes after navigation
  • Event appears in DebugView
  • GA4 counts match real submissions closely

How to prevent it happening again

Prevention habits
  • Add transport_type: 'beacon' to every event that fires on submit, outbound click or redirect.
  • Keep a note in your tagging plan of which events fire right before navigation.
  • Retest conversion events after theme, form plugin or GTM changes.
  • Compare GA4 conversion counts with real leads or orders each week.
  • Run a scheduled test of the full form journey so a regression is caught within a day.

How FunnelGuard handles this

FunnelGuard detects this issue only partly. A robot visitor runs your real journey, such as a lead form, and checks the tracking hits sent to GA4 and other platforms. If the expected hit is missing after the journey step, FunnelGuard flags it.

What it does not do is name the cause. A missing hit can come from a cancelled unload, a broken trigger, consent settings or a wrong event name. FunnelGuard does not tell you that the beacon transport is the reason.

To cover the rest by hand, open DevTools on the same journey, tick Preserve log, and look for a collect request marked (canceled). If you see one, apply the beacon fix above and retest. FunnelGuard failures are re-checked from a second region before one alert is sent, with a screenshot and a likely cause, so you will know the hit is missing before you start digging. The Free plan covers 1 site and 2 journeys with daily checks, no card needed.

Questions people ask

Why is my GA4 event not showing up after a form submit?

One common cause is that the page redirects before the GA4 request finishes, so the browser cancels it. Check the Network tab for a collect request marked canceled. If you see one, send the event with transport_type: 'beacon'.

What does transport_type beacon do in GA4?

It tells the GA4 tag to send the hit with the browser's navigator.sendBeacon() method. The browser completes the request in the background even if the page unloads, so the event is not lost.

How do I set transport_type to beacon in Google Tag Manager?

Open your GA4 Event tag and add a field named transport_type with the value beacon under Fields to Set or Event Parameters. Test in Preview mode, check DebugView, then publish the container.

Why does my GA4 hit show as cancelled or net::ERR_ABORTED?

It usually means the page navigated away or closed before the request completed. Beacon transport avoids this. Note that some browsers display successful beacon requests as cancelled, so confirm in DebugView.

Will beacon transport fix every missing GA4 event?

No. It only fixes events lost because the page unloaded. Missing events can also come from a wrong trigger, a typo in the event name, consent blocking or a blocked script, so check those if beacon does not help.

Does the beacon delay the visitor or slow the page?

No. The browser sends the request in the background, so you do not need to hold the visitor on the page while it finishes.

Can FunnelGuard tell me if a hit was cancelled by page unload?

Only partly. FunnelGuard flags that an expected tracking hit is missing after a journey step, but it does not name the cause. You can confirm the unload cause yourself in DevTools by looking for a cancelled collect request.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: missing hit seen; cause not named.

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.