Glossary

Autocapture

Autocapture is a method of collecting product-analytics events automatically (page views, clicks, scrolls, and form submissions) from a single SDK snippet, without defining each event in code beforehand.

A live feed: page_view, click, rage_click, scroll and form_submit arrive with no tracking code; order_completed comes from a track() call.

How autocapture works

An autocapture SDK (also written auto-capture, or called automatic event tracking) attaches a few listeners to the whole page instead of a tracking call to every button. Pug’s Web SDK, for example, listens on window for click, input, submit and scroll, and wraps history.pushState so a route change in a single-page app counts as a page view. When one fires, the SDK reads what the element shows about itself (its tag, id, class and own text), adds the page URL, referrer and UTM parameters, queues the event and sends it in a batch. The server adds country, city, device and browser on ingest.

Autocapture vs manual event tracking

Manual (or “explicit”) tracking means calling a function like track('order_completed') for each event you care about. It’s precise and well-named, but slow to set up and easy to forget. Autocapture gives you behavioral data the moment the SDK is installed, including interactions no tracking plan would have predicted. The trade-off is that raw captured events are noisier than curated business events.

On data quality, each one fails in its own way. Autocaptured events are keyed to the page: an element’s text, its id, class or selector, and the URL. Rename a button or restructure a page and a metric built on the old ones quietly splits in two. Manual events stay stable for as long as the code does, but they only cover what someone remembered to instrument, and their names drift (signup, sign_up, SignUp) unless a naming convention is enforced. Most teams run both: autocapture for the long tail, plus a handful of named events for key conversions.

Frustration signals

Richer autocapture also records rage clicks (rapid repeated clicks on one spot) and dead clicks (clicks that change nothing), early signs that a UI is confusing or broken. The thresholds differ: Pug counts four clicks within a second inside 40 pixels, Mixpanel four within a second inside 30 pixels (Mixpanel autocapture docs), and PostHog three, each within 30 pixels and a second of the last (PostHog autocapture docs). Pug calls a click dead when, half a second later, the URL, the page’s DOM and the text selection are all unchanged.

Example: what autocapture records

Install Pug’s Web SDK on a store and one visit to a product page sends this, with no tracking code written:

  • page_view: /products/blue-runner, with the referrer and page title
  • click: tag BUTTON, class add-to-cart, text “Add to cart”
  • rage_click: four clicks in a second on an “Apply coupon” button that does nothing
  • form_start and form_submit: form id checkout, the submit’s action URL, and nothing typed into the form

You never planned the rage_click, but it’s the signal that the coupon field is broken.

What autocapture should never record

An autocapture SDK sees every field on the page, so the rule that matters most is that it never sends what a person typed: no input values, no passwords, nothing from a text area or a rich-text editor. Mixpanel and Amplitude exclude user-entered text by default (Mixpanel autocapture docs, Amplitude autocapture docs), Heap doesn’t capture the contents of input fields (Heap web SDK docs), and PostHog leaves form values out of submissions (PostHog autocapture docs). What’s left is text the page displays, like a button that shows an email address.

Pug’s Web SDK sends a form as two events: form_start the first time a field in it changes and form_submit when it’s sent. Both carry the form’s id and name, and the submit its action URL; no field names and no values. A click sends the element’s own text, up to 50 characters, never the text of elements nested inside it and nothing from a <textarea> or contenteditable region. Query parameters such as token, email and password in a URL are replaced with redacted before anything is sent. Add data-pug-no-capture to blank an element’s text and everything inside it. Before you ship, check your event properties for personally identifiable information with the PII event auditor.

Which analytics tools have autocapture

Autocapture started as Heap’s signature and is now common in product analytics. On the web, tools differ in what they record and in whether it runs before you change a setting. We build Pug, so it is listed first.

From each vendor’s own docs, checked November 21, 2026. The last column links the source.
ToolRecords on the webOn by defaultSource
Pugpage_view, click, scroll, form_submit, rage_click, dead_clickYes, after init()Pug Web SDK reference
HeapPage views, clicks, form submits and field changes. An event you define later counts back to the day you installed Heap.Yes, from installHeap web SDK docs, Heap’s autocapture post
PostHogPage views and page leaves, clicks on links, buttons and form fields, form submissions and changes, rage clicks. Dead clicks are a project setting.YesPostHog autocapture docs
AmplitudePage views, sessions, form starts and submits, file downloads, campaign attribution. Element clicks, rage and dead clicks, failed network requests and web vitals come with autocapture: true.The first set only; settings saved in Amplitude can override the snippetAmplitude Browser SDK 2 docs
MixpanelPage views, scrolls, form interactions, clicks and changes on elements, attribution, rage and dead clicksNo, off until you add autocapture: trueMixpanel autocapture docs
Google Analytics 4page_view. Enhanced measurement adds scrolls to 90% depth, outbound link clicks, site search, video engagement, file downloads, form_start and form_submit, but not other clicks.Page views always; the rest is one switch per web data streamGA4 enhanced measurement help
PlausiblePageviews, outbound link clicks, file downloads and form submissions. Other clicks are events you tag.Yes, on a new sitePlausible outbound links, file downloads, form submissions
UmamiPage views. Any other event is a data-umami-event attribute or a umami.track() call.Page views onlyUmami event docs

For how these tools compare beyond autocapture, see the best product analytics tools roundup.

Autocapture in mobile apps

Click-level autocapture is web-only in Pug: the Android, iOS and Flutter SDKs record no taps. What they send on their own after init is the app’s lifecycle and its screens:

On iOS, a SwiftUI view is named with .pugScreen.
EventAndroidiOSFlutter
app_openthe app comes to the foregroundthe app comes to the foregroundthe app comes to the foreground
app_closethe app leaves the foregroundthe app goes to the backgroundthe app goes to the background
screen_vieweach activity shown, named by its classeach view controller, and SwiftUI views you nameeach route change, once PugRouteObserver is added
app_installthe first launch, with the store it came fromthe first launch, with App Store or TestFlightthe first launch on a device
app_updatethe first launch of a new versionthe first launch of a new versionthe first launch of a new version

Other tools draw the line elsewhere. PostHog’s Android and iOS SDKs record screen views and lifecycle events by default; taps are opt-in on iOS and React Native and unsupported on Android and in Flutter apps (PostHog autocapture docs). Mixpanel’s Android, iOS, React Native and Flutter SDKs capture screen views, clicks, dead clicks and rage clicks, but screen views need a hook into your navigation and clicks stay off until you turn them on (Mixpanel autocapture docs). Amplitude’s iOS and Android SDKs send session events by default; lifecycle events, screen views and taps are options you add (Amplitude iOS docs, Amplitude Android docs). Heap records interactions and screen changes once you add its separate autocapture package (Heap iOS docs, Heap Android docs). Pug’s setup is in the Android guide, iOS guide and Flutter guide.

How Pug does autocapture

Every Web SDK tracker runs after one init(); to keep fewer, the autoCapture option takes an allowlist. Capture starts cookieless: events flow, but nothing is stored on the device until a visitor consents, so identify() does nothing before then. Autocaptured events land in trends, funnels, retention and user flows beside the events you name with track(). Every option is in the Pug Web SDK reference.

Is autocapture better than manual event tracking?

Neither is strictly better. Autocapture covers interactions you didn’t plan for and gives you data from the day you install it; manual tracking gives precise, well-named business events. Most teams run both: autocapture for breadth, a few custom events for the moments that matter.

Does autocapture slow down my site?

The cost is a few listeners and a request every few seconds. Pug’s Web SDK listens once on the window rather than on each element, sends at most one scroll event every two seconds, and batches events into requests of up to 10, at least every 5 seconds.

What does autocapture record?

On the web: page views, clicks (the element’s tag, id, class and visible text), scroll depth, and form starts and submits, and in many tools rage clicks and dead clicks. In mobile apps it usually means app opens, installs, updates and screen views, with taps an opt-in where a tool supports them. It should never record what a person typed into a field.

Which tools turn autocapture on by default?

Heap captures from install, and so does PostHog’s web SDK. Plausible tracks outbound links, file downloads and form submissions on a new site. Amplitude’s Browser SDK turns on page views, sessions, forms and file downloads, but element clicks need autocapture: true. Mixpanel’s autocapture stays off until you add autocapture: true. GA4 always records page views, and enhanced measurement adds the rest with one switch. Pug’s Web SDK captures page views, clicks, scrolls, forms, rage clicks and dead clicks after init().

Send your first event.

Create a project, add the snippet, and watch the Live view fill up. Or open the demo first: the real dashboard on a sample pet shop, with no sign-up.

Questions? Email hello@pug.sh