Delayed-event service · enriched Page Viewed POC

One page view. Completed later.

The SDK sends the original Page Viewed to Amplitude’s heartbeat service. Heartbeats update that pending event; when the page ends or expires, the service adds engaged_time_seconds to the same event and forwards it to ingestion.

proposed · not production-readyone Page Viewed event5s activity window15s heartbeats · Chartbeat parity2h inactivity expiry
Start here · the idea in 20 seconds

Measure attention, then finish the original event.

Today, Page Viewed is normally sent immediately—before its engaged time is known. This POC proposes briefly holding that event in an Amplitude heartbeat service, updating one property over time, and sending the completed event to ingestion.

1A visit starts

The browser creates one Page Viewed event. The service holds it instead of sending it to Amplitude yet.

2Attention accumulates

Recent input counts as engaged time. Heartbeats update the same pending record; they are not analytics events.

3The visit ends

Navigation or expiry finalizes the record. Amplitude receives one Page Viewed with the final duration attached.

Follow the live proposal

See the full lifecycle in five steps

Current · Step 1

01 · Look at the Browser SDK clockLet attention expire

Stop interacting for five seconds. The activity window reaches zero and engaged time pauses.

02 · Look at Browser attentionScroll to re-engage

Scroll anywhere on the page. The tracker returns to ENGAGED and the five-second window restarts.

03 · Look at the Amplitude heartbeat serviceSend the next snapshot

Advance 15 seconds. The service replaces the pending Page Viewed with its latest cumulative engaged time.

04 · Choose one endingNavigate—or remain inactive

These paths are alternatives. Navigation attempts immediate finalization; two-hour inactivity is the expiry fallback.

05 · Compare the old and new viewsOne finalized + one new

Navigation starts the next page immediately. After expiry, simulate returning at hour three to create a new Page View for the same URL.

At Step 4, choose only one completion path.

Live state of this simulated page visit

These values update in your browser only

ENGAGEDIs the user active right now?
0.0sCumulative active-attention time
PENDINGHolds the event until the visit ends
15.0sChartbeat-aligned active cadence
2h 00mReset by activity—not heartbeat traffic

1 · What happens in the browser

Article A
5.0
activity window remaining

Mouse, scroll, click, touch, keyboard, load, and focus renew a five-second activity window. This simulation snapshots every 15 seconds. The separate two-hour expiration deadline resets only on qualifying activity; heartbeat traffic must not keep an inactive page alive.

2 · Amplitude heartbeat service

1 pending event
Page Viewed
buffered
Heartbeats
update
Page Viewed
forwarded
Page ViewedPENDING · NOT IN INGESTION YET
Waiting for finalization

This is one event, shown as one record. The ID identifies the Page Viewed; engaged_time_seconds is a field updated on it. Heartbeats do not create additional analytics events.

Heartbeat service update history

1 service update
atpageoperationtriggerengaged so farsnapshot

3 · Amplitude ingestion service

final destination

One logical Page View exists and is still pending.

pageeventproperty
PATH A · NAVIGATION

The page ends explicitly

On pagehide/beforeunload, the SDK attempts one final cumulative snapshot and asks the service to finalize immediately. Delivery is not guaranteed. Chartbeat reports about 68% success for its combined unload mechanisms. For same-site navigation, Chartbeat stores the previous pinger state on the client for up to an hour and can resend it when another page on the domain loads Chartbeat. Whether the Amplitude SDK should add that client-side handoff remains an open design question. Chartbeat methodology ↗

PATH B · INACTIVITY

The page remains open but inactive

After two continuous hours without qualifying engagement, the client finalizes if its timer is running. If the browser suspended the client, the delayed service timeout finalizes the latest successful snapshot. Returning at hour three creates a second logical Page View—even in the same tab and at the same URL—with new page_view_id, insert_id, timestamp, and zeroed counters.

Proposed data path

Delay and enrich the original event

① Browser SDK

Sends Page Viewed once to the heartbeat service, then sends engagement heartbeats carrying the current cumulative duration.

② Amplitude heartbeat service

Holds the original event and updates its pending engaged-time property. Navigation, lifecycle end, or the two-hour expiry finalizes it.

③ Amplitude ingestion service

Receives that same Page Viewed event with engaged_time_seconds attached. No separate engaged-time event.

What this proposal buys

A single canonical Page Viewed event, final engaged time attached to the correct page, active-attention semantics, and final-page recovery from the latest stored snapshot.

Unresolved product costs

Open Page Viewed events are absent from ordinary queries, funnels, and session construction. Production work still needs ordering, BFCache, suspension, offline, multi-tab, shared-heartbeat, and first-class metric decisions.