Autocapture and actions
The web SDKs capture clicks on links and buttons and form submits on their own, with no code. You choose which ones matter later, in Glancy, by naming them as actions ("Clicked Add to cart", "Submitted Newsletter"). Each action becomes an event you can use in every report, including the last 30 days before you created it.
Autocapture works with the script tag, the npm package and Next.js, and is on by default.
What's captured
- Clicks on links, buttons (including
<input type="submit">andtype="button") and elements withrole="button",link,menuitemortab. - Form submits.
For each one Glancy keeps the element's label (its text, aria-label or title, up to 80 characters), a short CSS
selector, where a link goes (without its query string or #hash) and the page. Clicks on anything else, typing,
scrolling and mouse movement are not captured.
What people type is never sent: not input values, not form fields. Text that looks like an email address or a
long number (a card or phone number) is replaced by •••.
Turn it off, or hide parts of the page
<!-- script tag: off, or captured without any element text -->
<script defer src="https://ingest.heyglancy.com/glancy.js" data-key="YOUR_WRITE_KEY" data-autocapture="false"></script>
<script defer src="https://ingest.heyglancy.com/glancy.js" data-key="YOUR_WRITE_KEY" data-autocapture="mask"></script>
// npm
new BrowserClient({ writeKey: "YOUR_WRITE_KEY", host: "https://ingest.heyglancy.com", autocapture: false });
new BrowserClient({ writeKey: "YOUR_WRITE_KEY", host: "https://ingest.heyglancy.com", autocapture: { maskAllText: true } });
// Next.js
<GlancyProvider autocapture={false}>{children}</GlancyProvider>
On single elements or whole sections:
| Attribute | Effect |
|---|---|
data-glancy-mask (or class glancy-mask) |
Captured without its text |
data-glancy-block (or class glancy-block), data-glancy-no-capture |
Not captured at all |
Elements that already send a named event with data-glancy-event aren't captured a second time.
stopRecording() stops autocapture too, like replay and heatmaps.
Make an action
- Open Data → Actions (Data is at the bottom of the sidebar). The lower list shows what was captured in the last 30 days, grouped by element and page, with how often and by how many people. Switch between Clicks and Form submits, or search by text, page or link.
- Click Make action on a row and give it a name, like "Clicked Add to cart".
- Choose what has to match: the same text, the same element, or both. Matching on text catches the same
button wherever it appears; matching on the element is better when the text changes (prices, counts). Tick Only
on the page to limit it to one page, or to a section with a
*, like/blog/*. - Make action. Glancy turns the matching clicks from the last 30 days into events right away, and every new one as it happens.
The event has the action's name and these properties: element_text, element_selector, href (links),
path and autocapture (click or submit). Use it in Insights, Funnels, Retention, Flows, cohorts and
notifications like any other event.
Renaming an action changes the name of new events only; deleting it stops new events and keeps the ones it made. Analysts and admins can make, rename and delete actions; everyone with access to the bucket can see them.
Billing and limits
- Captured clicks and submits aren't billed as events. They have their own monthly allowance: 2M on Starter, 10M on Growth, 40M on Pro, custom on Enterprise. Autocapture is part of the infrastructure every plan includes. When it's used up, Glancy stops storing new ones until the month ends (nothing is charged), and Settings → Org → Usage shows how much is left. At most 200 are captured per page view.
- Events made by actions are billable events, like any
trackcall, including the ones backfilled from the last 30 days (they count in the month you create the action). Actions keep making events even when the allowance is used up. - Captured clicks and submits are kept for 30 days (less if your bucket keeps replays and heatmaps for less), then deleted. The events your actions made follow your normal event retention.
Performance
Autocapture's code is a separate file of about 2.5 KB (gzipped, shared with heatmaps), fetched right after the SDK starts, so it never delays your page; clicks in the moment before it arrives are kept and sent. It listens once on the document instead of on each element, does no layout work when someone clicks (a few hundredths of a millisecond per click), and sends what it captured in one small request every few seconds, in idle time or when the page is hidden.