Next.js — next/script "beforeInteractive"
Next.js high-priority script strategy. The script is injected into the HTML before React hydrates, with the defer attribute applied automatically. Like the head-defer scenario, the defer attribute guarantees that wire.js runs before window.load — so V1 should always pass here. Use this as a baseline that confirms wire.js itself is reachable and the test harness is working.
Each side runs the same scenario in its own iframe. The iframes load independently, so you can see how each pixel version behaves under identical conditions.
How to test:
- Load the page and wait ~5 seconds.
- Confirm wire.js timing is BEFORE window.load.
- Check both pixel columns.
Expected: Both V1 and V2 fire reliably. If V1 fails here, the issue is not the race condition — check the script URL, network connectivity, or the served wire.js source.
V1 · current pixel
Verdict
Initialising…
window.load
—
wire.js
—
pixel
—
Event timeline
- No events recorded yet…
Script tag for this scenario
// Rendered from pages/_document.js
<Script src="https://staging-api.wire.spbx.app/wire.js?account_id=79&property_id=6a2111320c2dee2dc5548935"
strategy="beforeInteractive" />V2 · proposed fix
Verdict
Initialising…
window.load
—
wire.js
—
pixel
—
Event timeline
- No events recorded yet…
Script tag for this scenario
// Rendered from pages/_document.js
<Script src="https://staging-api.wire.spbx.app/wire.js?pixel_id=6a211df10c2dee2dc5548936&account_id=79&property_id=6a2111320c2dee2dc5548935"
strategy="beforeInteractive" />