Autocapture reference (browser SDK)

Every autocapture option of the browser SDK, the events and properties it sends, and how to turn rage clicks, dead clicks and scroll depth on or off.

Embed
Preview of the card
<a href="https://lucidace.com/help/autocapture-reference"><img src="https://lucidace.com/help/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/2f4b888b-c4e6-488b-81bd-6e838fb12d2e/pages/1550d9b4-b3e1-4f62-8919-e28fff98c45f/social-card.svg?v=3e7ae33eec8b" alt="Autocapture reference (browser SDK)" width="600" height="315"></a>

init(key, { autocapture }) takes true (default), false, or an object with the options below. All names are from AutocaptureConfig in @lucida-analytics/browser.

import { init } from "@lucida-analytics/browser";

init("lc_pk_...", {
  autocapture: {
    captureText: false,
    denySelectors: [".private"],
    rageClicks: { count: 4, windowMs: 1500 },
    deadClicks: { waitMs: 1000 },
  },
});

Frustration and scroll signals

Signal

Event and properties

Turn off

Rage click

Properties on the $autocapture click event: $rageclick: true and $rageclick_count (clicks in the burst, including this one)

autocapture: { rageClicks: false }

Dead click

A separate $deadclick_hint event with $selector and $no_mutation_ms

autocapture: { deadClicks: false }

Scroll depth

On $pageleave: $scroll_depth (furthest point reached, 0 to 100 percent of the page), $scroll_depth_px, and $engagement_time_ms (time the page was visible)

capturePageleave: false

Rage clicks. Defaults: 3 clicks within 1000 ms and 30 px of each other. rageClicks takes count, windowMs, radiusPx, ignoreSelectors, ignoreTextSelection (default true: no count while text is selected), suppressSteppers (default true: number inputs, plus and minus buttons, quantity and carousel controls are not counted) and stepperSelectors (your own steppers). Add the class lc-no-rageclick or the attribute data-lc-no-rageclick to an element to exclude it. These are client hints; the signals pipeline on the server stays the authority for frustration analysis.

Dead clicks. Sent only for a trusted click on a non-interactive element, when nothing happens afterwards: no DOM change, no scroll, no text selection within waitMs (default 700). Not sent while the tab is hidden. deadClicks takes waitMs and ignoreSelectors.

Scroll depth. Measured on the page, or on the element named by the top-level scrollRoot option (a CSS selector or a list; the first match wins) for app shells where an inner element scrolls. $pageleave is sent when a page is left, on a single-page route change, or on unload. capturePageleave is "if_capture_pageview" by default (sent when pageviews are), true (also without pageviews) or false.

Other autocapture options

Option

Default

Effect

events

click, change, submit

Which DOM events are captured

captureText

true

Element text (form control text is never captured)

allowSelectors, denySelectors

none

Only capture inside, or never capture inside, these selectors

urlAllowlist, urlIgnorelist

none

Pages where autocapture is on, or off (ignore wins)

elementAllowlist

none

Only targets inside these tags, such as ["a", "button"]

attributeIgnore

none

Attribute names kept out of $elements; a trailing * is a prefix (data-*)

maskAllAttributes, attributeAllowlist

false

Replace every attribute value with ***, except the allowlisted names

Project setting autocapture_inputs

true

PUT /v1/projects/{id}/settings/sdk {"autocapture_inputs":false}: no input, change or submit autocapture (or contenteditable edits); clicks are still captured. Read from GET /v1/config, so it applies once the config has loaded; the page option events: ["click"] does the same locally

contentEditable

true

$autocapture change events for contenteditable regions: the element chain only, never the content

copyCut

false

$copy_autocapture with $copy_type on copy and cut

captureCopiedText

false

With copyCut: also $selected_content, digits masked, cut to 255 characters

outboundLinks

true

$outbound_click on links to other hosts

fileDownloads

true

$file_download; true uses the built-in extension list, an array is your list

siteSearch

true

$site_search when the URL has a search param (q, s, search, query; or { params: [...] })

contentBlocks

true

$content_impression and $content_interaction for elements with data-lc-content (nothing without the attribute)

articles

true

$article_read for the article region (data-lc-region="article" or articleSelector)

media

true

$media_play, $media_progress (25, 50, 75 percent) and $media_complete for <video> and <audio>

Consent applies to all of it: nothing is stored or sent before the visitor allows analytics unless you configured queueing or anonymous mode. See Cookie munch and Replay privacy.

Updated