Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions content/docs/web-analytics/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
27 changes: 17 additions & 10 deletions content/docs/web-analytics/session-replay.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading