Skip to content

Autocapture

What the web library records on its own, how to keep sensitive elements out, and how to turn autocapture off or narrow it down.

Autocapture records the interactions on your site without any tracking code. It means you have data from the day you install the snippet, including for questions you had not thought to ask yet.

What is captured

With the web snippet installed, the library records:

EventWhen
$pageviewA page loads, or a single-page app changes the page's path.
$pageleaveA visitor leaves a page.
$autocaptureA visitor clicks, changes or submits an element: links, buttons, forms, inputs, selects, text areas and labels.
$rageclickA visitor clicks the same place repeatedly in a short time.

Each $autocapture event records what was interacted with: the element's tag, its text, its classes and other attributes, and the chain of elements around it, so you can tell one button from another.

What is not captured

Autocapture is designed to keep personal data out.

  • What people type is not recorded. For inputs, selects, text areas and editable content, only the element's name, id, class and aria-label are sent, never its value.
  • Password and hidden fields are never captured, nor are fields whose name or ID suggests card, security code, password or social security details.
  • Values that look like card numbers or social security numbers are left out.

To keep an element, and everything inside it, out of autocapture, add the mj-no-capture class:

html
<div class="account-details mj-no-capture">
  <!-- clicks in here are not autocaptured -->
</div>

mj-sensitive does the same.

For elements you want to leave out of session recordings, see Session replay; mj-no-capture also blocks an element from recordings.

Data attributes

Autocapture records every attribute on an element, so a stable attribute such as data-attr="pricing-cta" is the most reliable way to recognise it later, even when its text or styling changes.

In Settings → Project → Autocapture, under Data attributes, list the attributes your site uses, such as data-attr or data-testid. Use * as a wildcard, for example data-*. The toolbar and the action editor then prefer these attributes when they build a selector for an element.

Use autocaptured events

Raw $autocapture events are easiest to use through actions: an action gives a name such as "Clicked pricing button" to the clicks that match a selector, text or page. Actions apply to past events too, so you can define one today and see its history straight away.

Turn autocapture off or narrow it down

  • For the whole project: in Settings → Project → Autocapture, turn off Enable autocapture for web. This overrides the code on your site.
  • In code: start the library with autocapture: false, or with an object that limits it to certain pages, events or elements; see Configuring the library.
  • Rage clicks: start the library with rageclick: false.

Pageviews are controlled separately, with the capture_pageview option.

In Settings → Project → Autocapture you can also turn on:

  • Web vitals autocapture, which records loading and responsiveness metrics from Chrome's web vitals;
  • Dead clicks autocapture, which records clicks that change nothing on the page, pointing to elements people expect to work.

Can't find what you need? Contact support