diff --git a/content/docs/web-analytics/configuration.mdx b/content/docs/web-analytics/configuration.mdx index 0f3c980..5688f09 100644 --- a/content/docs/web-analytics/configuration.mdx +++ b/content/docs/web-analytics/configuration.mdx @@ -139,13 +139,14 @@ export function diagnostics(): AnalyticsExtension { The context exposes `siteKey`, `baseUrl`, `debug`, `trackHash`, `isCookieless()`, and `on(hook, handler)`. -| Hook | Payload | When it fires | -| --------------- | ------------------------- | -------------------------------------------------- | -| `pageChange` | `{ url }` | After a client-side navigation to a new page | -| `pageHide` | `{ persisted, terminal }` | When the page is hidden or unloaded | -| `pageShow` | `{ persisted }` | When the page is shown, including from the bfcache | -| `consentChange` | `{ cookieless }` | When consent changes while tracking stays enabled | -| `error` | `{ error }` | When `reportError` is called | +| Hook | Payload | When it fires | +| ---------------- | ------------------------- | -------------------------------------------------- | +| `pageChange` | `{ url }` | After a client-side navigation to a new page | +| `pageHide` | `{ persisted, terminal }` | When the page is hidden or unloaded | +| `pageShow` | `{ persisted }` | When the page is shown, including from the bfcache | +| `consentChange` | `{ cookieless }` | When consent changes while tracking stays enabled | +| `identityChange` | `{ userId }` | When `identify` sets a user or `logout` clears it | +| `error` | `{ error }` | When `reportError` is called | Extensions start when tracking starts and stop when the client is destroyed or consent is denied. Cleanup receives `discard: true` when consent was revoked. diff --git a/content/docs/web-analytics/session-replay.mdx b/content/docs/web-analytics/session-replay.mdx index 0465fa3..08bffde 100644 --- a/content/docs/web-analytics/session-replay.mdx +++ b/content/docs/web-analytics/session-replay.mdx @@ -132,16 +132,23 @@ Replay events are buffered in the browser and uploaded in gzip-compressed batches. The recorder also flushes when the page is hidden, when the session rotates, and when a batch reaches its event or byte limit. -| Option | Type | Default | Description | -| ------------------- | --------- | --------- | ----------------------------------------------------------- | -| `flushInterval` | `number` | `15000` | Milliseconds between uploads | -| `maxEvents` | `number` | `1000` | Events per batch before an early flush | -| `maxBatchSizeBytes` | `number` | `921600` | Batch size before an early flush | -| `maxPendingBatches` | `number` | `30` | Batches that may wait for upload | -| `maxQueueSizeBytes` | `number` | `2097152` | Memory limit for buffered replay data | -| `minReplayLengthMs` | `number` | `3000` | Recordings shorter than this are discarded | -| `checkoutEveryNms` | `number` | `300000` | Milliseconds between full DOM snapshots | -| `compress` | `boolean` | `true` | Gzips batches when the browser supports `CompressionStream` | +| Option | Type | Default | Description | +| ----------------------------- | --------- | --------- | ----------------------------------------------------------- | +| `flushInterval` | `number` | `5000` | Milliseconds between uploads | +| `maxEvents` | `number` | `1000` | Events per batch before an early flush | +| `maxBatchSizeBytes` | `number` | `921600` | Batch size before an early flush | +| `maxLowLatencyBatchSizeBytes` | `number` | `57344` | Batch size for the final upload when a recording ends | +| `maxPendingBatches` | `number` | `30` | Batches that may wait for upload | +| `maxQueueSizeBytes` | `number` | `2097152` | Memory limit for buffered replay data | +| `minReplayLengthMs` | `number` | `3000` | Recordings shorter than this are discarded | +| `checkoutEveryNms` | `number` | `300000` | Milliseconds between full DOM snapshots | +| `checkoutEveryNth` | `number` | none | Events between full DOM snapshots | +| `compress` | `boolean` | `true` | Gzips batches when the browser supports `CompressionStream` | + +When a recording ends, for example because the page is closed, the remaining +events are sent uncompressed in batches of at most +`maxLowLatencyBatchSizeBytes` so they fit in a request that outlives the page. +This option can only be lowered from its default. If the queue limits are reached, capture stops for that recording instead of leaving a gap.