Skip to content

Experience

The Experience module powers aggregate interaction maps and issue evidence. It is lazy loaded from the core SDK only after consent and after the site’s remote policy allows capture.

import { init } from '@leadmaps/tracking';
init({
apiKey: 'lk_your_key',
siteId: 'your-site-uuid',
host: 'https://collect.leadmaps.nl',
defaultConsent: 'unknown',
experience: true,
});

Call grantConsent() from your consent banner when the visitor agrees. You do not need to import or start the Experience subpath yourself.

You can omit experience to follow the site’s remote setting without local restrictions. experience: true makes that intent explicit and has the same remote-policy behavior.

Workspace owners and admins manage the remote setting under Experience > Settings in the dashboard. The SDK refreshes that setting about once a minute with a small timing spread, and whenever the page returns to the foreground.

Set experience: false to guarantee that the page never imports or starts the module, even if the remote site setting is enabled.

init({
apiKey: 'lk_your_key',
siteId: 'your-site-uuid',
host: 'https://collect.leadmaps.nl',
experience: {
sampleRate: 0.25,
blockSelectors: ['[data-private-panel]', '.account-settings'],
captureForms: false,
},
});
OptionMeaning
sampleRateA local ceiling between 0 and 1. The lower local or server value wins.
blockSelectorsAdditional page regions that Experience must ignore. Local and remote exclusions are combined.
captureFormsSet to false to disable safe form-progression counters. It cannot override a server-side disable.

These options only restrict the site policy. They cannot grant capture that the server, plan, privacy mode, or consent state denied.

  • With consent unknown, there is no configuration request, Experience import, listener, recording buffer, or Experience transmission.
  • After consent is granted, the SDK fetches the current site policy. A failed or invalid initial response leaves capture disabled. A failed later refresh stops active capture until a subsequent policy request succeeds.
  • Revoking consent stops listeners, aborts configuration work, and clears the active in-browser capture state.
  • privacy: 'anonymous' always disables Experience, even when experience: true is present.

See Consent gating for the full SDK and collector flow.

Compact Experience analytics sends three bounded categories:

  • Page summaries contain aggregate element exposure and activation counts, scroll exposure, pointer-density cells, broad gesture totals, visible time, and safe form-progression counters.
  • Issue signals are small occurrence markers that connect a detected problem with aggregate issue analysis and an available recording moment.
  • Health diagnostic bodies contain only a fixed status code and version numbers. They measure whether consented capture started or failed without adding page content, selectors, URLs, messages, or visitor identifiers to the body. The request still carries the site routing headers and required consent proof. The collector validates that proof but does not retain it with the diagnostic.

These compact analytics payloads do not send page text, raw DOM, CSS class lists, URL query strings, typed values, keystrokes, raw pointer paths, pointer identifiers, pressure, tilt, or persistent device identifiers.

Form progression uses only a broad field category, position in the form, time, and validation or completion counters. Password, payment, file, free-text, and editable-content fields are always excluded.

Adaptive replay is a separate, consented data stream controlled by the remote policy and plan. It records masked page structure and changes so the player can reconstruct what happened. It is not a video or screen capture. Text and form values are masked before recording, and configured blocked regions are omitted. Do not place secrets in page markup, URLs, or browser-visible attributes; replay masking is an additional privacy control, not a replacement for secure page design. Replay keeps console severity and timing as a breadcrumb, but logged arguments and error messages are replaced with a fixed hidden-details marker.

leadmaps retains no more than three adaptive clips per session. Additional triggers are rejected or combined so one difficult moment does not create duplicate clips.

The module supports mouse, touch, and pen through feature-detected browser events and includes fallbacks for older capabilities. It handles single-page app navigation, back-forward cache restoration, orientation changes, visual viewport changes, tab visibility, and page exit.

Pointer and scroll work is rate limited, scheduled, and aggregated before it is sent. Every page summary has fixed collection and payload bounds. This keeps the host page responsive and prevents a long or highly interactive page from creating an unbounded request.

For customer-facing interpretation, see Experience.