Skip to content
All field notes
Publisher measurement
Published
Oct 31, 2026
Reading time
10 min read

GAM Fallback Overwrites a Filled Slot? Trace the Callback

Diagnose GPT fallback code that replaces filled ads. Trace the event's slot, callback ownership, active lifecycle and render evidence before changing SRA.

AP
AdProof Research
Independent measurement desk
An empty-slot event is matched to its own placement while a guarded path protects a different filled slot from being overwritten.
Match the callback to the intended slot and active cycle before allowing fallback code to replace content. Conceptual illustration.
In this guide (11 sections)

If a filled ad briefly appears and fallback code replaces it, trace the callback that authorized the replacement before changing the auction or SRA settings. Establish which slot produced the event, which placement the fallback changes, and whether the action still belongs to the active lifecycle. An empty result for one slot is not permission to overwrite another.

A real publisher question about slotRenderEnded overwriting a filled unit describes dynamic slots, lazy loading and a waterfall fallback. The original poster later reports removing SRA and adding a first-tier fill check. Those simultaneous changes are a useful historical observation, not proof that SRA is universally incompatible with fallback logic or that either change alone fixed the cause.

The practical task is callback ownership and arbitration. Keep it distinct from whether a House creative is eligible to fill a particular request, and from a report's definition of unfilled impressions. A fallback can have an eligible creative and still run against the wrong placement.

Establish what the event actually describes#

Google's GPT reference says slotRenderEnded fires when creative code is injected, before the creative's resources are fetched. Its slot identifies the triggering slot, and isEmpty indicates whether an ad was returned. A null reservation line-item ID is not a substitute for that field; backfill can also have null IDs.

Google's event-listener sample separates request, response, code injection, iframe loading and viewability observations. Use those stages as separate evidence. Do not turn the callback name into a claim that every resource loaded, a user saw the ad or a report accepted an impression.

ObservationWhat to investigate next
Filled slot is later replacedWhich code path changed its content?
Empty event belongs to another slotWhy did fallback target the filled placement?
Empty result followed by a delayed actionIs the original lifecycle still active?
Same event triggers repeated actionsAre listeners or fallback owners duplicated?
No event capturedWas the observer installed in time and is evidence complete?

A CSS visibility check answers a layout question. It does not establish whether the ad server returned an ad for that slot. Keep layout, response state and creative lifecycle in different columns.

Related guide

Trace the fallback to the right slot

Record the event, destination and active slot lifecycle before changing the callback.

Use the tracking QA checklist

Opens a practical guide. No email required.

Draw the waterfall ownership before adding a guard#

Identify every component that can request, render, replace or clear the placement. A first-tier network, GAM tag, publisher fallback and page framework may all own part of the path. Write the intended order and its supported acceptance conditions.

For each placement, preserve:

Publisher placement and owning component:
Current mount/lifecycle reference:
GPT slot object and element reference, if present:
First-tier decision and supported receipt:
GAM request and event observations:
Fallback eligibility condition:
Component allowed to commit replacement:
Pending work to cancel at teardown:
Unavailable or ambiguous evidence:

Do not treat a shared ad-unit path as a unique DOM placement. Several slots can use the same path while occupying different elements. An element ID can also be reused after navigation, so keep the actual slot/lifecycle relationship as well as its readable name.

If the upstream network exposes only a delayed callback, agree how its result maps to the current placement. A variable such as filled is not sufficient evidence unless its owner defines when it is set, reset and invalidated.

Log one slot without triggering delivery#

The following diagnostic observes one already-created slot through the initialized GPT service. It does not define a slot, request an ad or execute fallback. Use it only in an authorized QA context and remove the listener when the observation ends.

function observeSlotRenders(service, ownedSlot) {
  const onRender = (event) => {
    if (event.slot !== ownedSlot) return;
    console.table([{
      observedAt: performance.now(),
      slotId: event.slot.getSlotElementId(),
      isEmpty: event.isEmpty,
      lineItemId: event.lineItemId,
      creativeId: event.creativeId
    }]);
  };
  service.addEventListener("slotRenderEnded", onRender);
  return () => service.removeEventListener("slotRenderEnded", onRender);
}

Call it through your established GPT-ready initialization path, with the intended slot reference, and retain the returned cleanup function. Install the observer before the relevant test request; it cannot replay events that occurred before registration.

This is an event log, not a complete request-correlation system or production fallback implementation. It intentionally contains no content replacement. Collect the application's lifecycle and request records alongside it. A GPT event does not supply an application-defined generation token simply because your code stores one in a variable.

Keep sensitive data out of shared diagnostics. Small metadata projections and authorized request references are more useful than an unrestricted dump of creative markup, cookies and browsing history.

Match the event to the destination that can change#

Inspect the actual fallback function, including any selectors and captured variables. Does it change the triggering placement or a broader collection? Does a closure still point at an earlier element? Does a shared state variable describe another slot?

A slot-specific condition is useful only if the action is equally scoped. Filtering an event correctly and then running a function that clears every ad container still creates a global side effect. Follow the entire mutation path, not just the if statement.

Use a small fixture with two placements: one filled and one empty. Trigger only the empty placement's supported event or test equivalent, then inspect which destination the fallback attempts to modify. The filled control should remain unchanged under the intended contract.

If the integration handles an entire group, define that group explicitly and test its agreed behavior. Do not turn a one-slot fix into an accidental roadblock or competitive-exclusion change. The roadblock counting guide explains why grouped serving and per-slot observations are different units.

Separate a stale action from the active lifecycle#

Correct slot matching does not, by itself, resolve a delayed callback after a placement has changed. The component may have unmounted, started another cycle or accepted content from another permitted source while fallback work was pending.

A useful design-review question is: what evidence gives this action permission to commit now? The answer belongs to the integration's state model. It may require one active owner, a current lifecycle reference, a supported request relationship and cancellation of obsolete work. These are proposed engineering controls, not hidden GPT API fields.

Do not merely attach the current generation number to an event when it arrives and call that correlation. A late event can arrive during a newer generation. If the implementation cannot safely establish ownership, retain the ambiguity, avoid conflicting replacement and request a supported sequencing design from its owner.

Google's reference documents slot destruction and listener removal. Use those documented interfaces rather than depending on private library state. Do not retain a slot after its owning page component has been removed incorrectly.

A hypothetical two-slot race#

Hypothetical example. These invented timestamps describe a synthetic fixture, not the forum poster's page or a customer result.

TimeFixture observation
400 msSlot A returns a filled result
450 msSlot B reports an empty result
500 msA shared fallback action incorrectly replaces slot A

Slot A's content lasts 500 - 400 = 100 ms in this fixture. The empty event belongs to B. Increasing an ad-server timeout would not repair the destination mismatch demonstrated by this test. The appropriate finding concerns the callback-to-placement mapping.

Now test a separate delayed-action fixture. B schedules fallback at 450 ms. A permitted newer lifecycle records filled content for B at 550 ms. The old scheduled action commits at 600 ms without checking ownership. The old action replaces newer content after 600 - 550 = 50 ms.

Slot matching is correct in the second fixture, but lifecycle arbitration is not. Keep the two failures separate so that fixing one does not hide the other. Neither fixture establishes how often the problem happens in production or the value of any affected delivery.

Check duplicate listeners and request scope#

A page component can register a listener each time it mounts and fail to remove the earlier registration. A single callback event can then lead to several fallback attempts. Count the actual registrations, callbacks and committed mutations separately.

In a hypothetical fixture, one empty result reaches three active handler instances and produces three action attempts. That is not three empty ad-server responses or three impressions. An acceptance test should verify the intended single owner and action budget for the placement, not simply that the fallback eventually appeared.

Google's ad-loading and refresh guide distinguishes initial registration, initial fetch and later refresh. Calls to refresh() without explicit slots affect all registered slots; passing an array scopes the call. Record what the running code actually requests before attributing unrelated slot events to a single intended placement.

Use the Prebid/GPT timing audit if auction-to-request sequencing is the first failed boundary. Do not remove SRA merely because callback order is confusing; Google's ad-slot best practices describes its role in page-level features.

Run an acceptance matrix before changing production#

Controlled testExpected evidence under the intended design
Filled A, empty BOnly B's permitted fallback path acts
Two independent empty slotsEach action maps to its own placement
Delayed old callback after a new lifecycleObsolete work cannot overwrite newer content
Component mount/unmount/remountListener ownership and cleanup remain defined
One event with duplicate registration attemptedDuplicate owners are detected or prevented
Unavailable correlationAmbiguity is preserved rather than treated as permission

Define the expected outcome with the integration owner before running the fixture. Keep other request and creative settings stable, use approved test mechanisms and avoid repeatedly refreshing or clicking live commercial ads.

After an approved correction, save the prior and revised code/configuration, bounded test results and unresolved environments. A successful two-slot fixture demonstrates that case, not universal production closure. Inspect representative templates and supported aggregates without silently excluding the difficult ones.

Keep the measurement finding separate#

A callback-routing repair does not prove higher revenue, valid traffic or a refund. Compare request, returned-content, creative-lifecycle and counted-impression records using the same scope and definitions. The ad-server discrepancy guide covers transport, counting and reporting after the serving decision.

If a fallback source returns a creative, record that source separately from paid first-tier delivery. Filling the container is not equivalent to satisfying the campaign's commercial requirement. A shorter visible blank period is another observation again.

Frequently asked questions#

Does isEmpty mean that the slot was hidden or never viewed?

No. It describes whether an ad was returned for the triggering slot. Layout visibility, creative loading and viewability are separate observations.

Why can an empty result replace another filled slot?

Inspect the action's destination, shared state and captured references. A listener can observe one slot while an overly broad fallback function changes another. The actual mutation trace establishes the cause.

Should I disable SRA to fix the overwrite?

Do not assume that is necessary. Trace slot and lifecycle ownership first, preserve the intended page-level delivery contract and test the smallest supported correction.

Does checking the slot ID solve every delayed callback?

No. The correct placement can have a newer lifecycle or source decision. The action must still have valid ownership when it commits; a recycled DOM identifier alone does not prove that relationship.

Compare delivery within a verified scope#

The anonymized fashion retail display case illustrates a documented delivery baseline. It does not certify a fallback implementation or establish how much revenue a routing defect affected.

Where AdProof measures the campaign, compare available event or aggregate exports with the publisher's delivery records over matching dates, timezone and supported filters. Keep the callback and DOM-mutation evidence with the page implementation owner. Discuss that delivery comparison without assuming an independent export can reconstruct an unrecorded callback or control the publisher's fallback code.

Your next step

Trace the fallback to the right slot

Record the event, destination and active slot lifecycle before changing the callback.

Use the tracking QA checklist

Opens a practical guide. No email required.

Back to all field notes